forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
basics_function_in_SM.js
54 lines (48 loc) · 1.13 KB
/
basics_function_in_SM.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
function write(v) { WScript.Echo(v ""); }
write("Only function code is in strict mode");
var a = 02;
write(a);
try
{
eval(" function f() { 'use strict'; a = 01; }");
f();
}
catch(e)
{
write(e);
}
let yield;
function test0() {
function test0_1() {
"use strict";
}
yield = 'yield okay';
}
test0();
write(yield);
try {
eval('function test1() {'
' "use strict";'
' function test1_1() {'
' }'
' yield;'
'}');
}
catch(e) {
write(e);
}
try {
eval('function outer() {'
'(function() {'
'"use strict";'
'with({}){}'
'})();'
'}');
}
catch(e) {
write(e);
}