forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInlineCallInstanceFunction.js
More file actions
39 lines (32 loc) · 1.05 KB
/
InlineCallInstanceFunction.js
File metadata and controls
39 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function Foo()
{
WScript.Echo("foo");
}
function DispatchCallInstance(callback, thisArg)
{
__chakraLibrary.builtInCallInstanceFunction(callback, thisArg);
}
function DispatchFooCallInstance() { DispatchCallInstance(Foo, {}); }
DispatchFooCallInstance();
DispatchFooCallInstance();
DispatchFooCallInstance();
// test bailout from inlined callback.call
function BailOut(ary)
{
ary[0] = 1;
}
function DispatchCallWithThis(callback, arg)
{
__chakraLibrary.builtInCallInstanceFunction(callback, this, arg);
}
function DispatchBailout(arg)
{
DispatchCallWithThis(BailOut, arg);
}
DispatchBailout([1]);
DispatchBailout([1]);
DispatchBailout([1.1]);