forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPartInitStackFrame.js
More file actions
30 lines (26 loc) · 998 Bytes
/
PartInitStackFrame.js
File metadata and controls
30 lines (26 loc) · 998 Bytes
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
// -nonative -InjectExceptionAtPartiallyInitializedInterpreterFrame:3 -InjectPartiallyInitializedInterpreterFrameErrorType:1
// We only check interpreter frame which ret addr matches one from frames pushed to scriptContext.
// Thus use same function body (causes same interpreter thunk).
function createFoo()
{
var foo = function(another)
{
if (another) another();
}
return foo;
}
try
{
var foo1 = createFoo();
var foo2 = createFoo();
foo1(foo2);
}
catch (ex)
{
var stackAfterTrimDirectoryName = ex.stack.replace(/\(.*\\/g, "(");
WScript.Echo(stackAfterTrimDirectoryName);
}