Skip to content

Commit 80bb9c5

Browse files
committed
Update global toStringTag to match attributes from v8
1 parent 4066031 commit 80bb9c5

File tree

89 files changed

+307
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+307
-41
lines changed

lib/Runtime/Library/JavascriptLibrary.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,10 @@ namespace Js
11421142
AddMember(globalObject, PropertyIds::Infinity, positiveInfinite, PropertyNone);
11431143
AddMember(globalObject, PropertyIds::undefined, undefinedValue, PropertyNone);
11441144
// Note: for global object, we need to set toStringTag to global like other engines (v8)
1145-
AddMember(globalObject, PropertyIds::_symbolToStringTag, scriptContext->GetPropertyString(PropertyIds::global) , PropertyNone);
1145+
if (globalObject->GetScriptContext()->GetConfig()->IsES6ToStringTagEnabled())
1146+
{
1147+
AddMember(globalObject, PropertyIds::_symbolToStringTag, scriptContext->GetPropertyString(PropertyIds::global), PropertyConfigurable | PropertyWritable | PropertyEnumerable);
1148+
}
11461149

11471150
// Note: Any global function added/removed/changed here should also be updated in JavascriptLibrary::ProfilerRegisterBuiltinFunctions
11481151
// so that the new functions show up in the profiler too.

test/Debugger/JsDiagGetStackProperties.js.dbg.baseline

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"this": "Object {...}",
44
"{exception}": "number 1",
55
"locals": {
6+
"Symbol.toStringTag": "string global",
67
"globalVar": "undefined undefined",
78
"FuncLevel1": "function <large string>",
89
"outerFunc1": "function <large string>"
@@ -12,6 +13,7 @@
1213
"this": "Object {...}",
1314
"{exception}": "Error Caught Error",
1415
"locals": {
16+
"Symbol.toStringTag": "string global",
1517
"globalVar": "undefined undefined",
1618
"FuncLevel1": "function <large string>",
1719
"outerFunc1": "function <large string>"
@@ -44,6 +46,7 @@
4446
"level1Var": "Object {...}"
4547
},
4648
"globals": {
49+
"Symbol.toStringTag": "string global",
4750
"globalVar": "Object {...}",
4851
"FuncLevel1": "function <large string>",
4952
"outerFunc1": "function <large string>"
@@ -97,6 +100,7 @@
97100
}
98101
},
99102
"globals": {
103+
"Symbol.toStringTag": "string global",
100104
"globalVar": "Object {...}",
101105
"FuncLevel1": "function <large string>",
102106
"outerFunc1": "function <large string>"

test/Debugger/MultipleContextStack.js.dbg.baseline

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"x": "undefined undefined"
8383
},
8484
"globals": {
85+
"Symbol.toStringTag": "string global",
8586
"script1": "Object {...}",
8687
"script2": "Object {...}",
8788
"Func2": "function <large string>",

test/DebuggerCommon/ES6_intl_simple_attach.js.dbg.baseline

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
}
2424
},
2525
"globals": {
26+
"Symbol.toStringTag": "string global",
2627
"x": "undefined undefined",
2728
"Run": "function <large string>"
2829
}

test/DebuggerCommon/ES6_letconst_const_reassignment_globalscope.js.dbg.baseline

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
},
66
"locals": {
77
"a": "number 1",
8-
"b": "number 2"
8+
"b": "number 2",
9+
"Symbol.toStringTag": "string global"
910
},
1011
"globals": {}
1112
},

test/DebuggerCommon/ES6_letconst_eval_nonstrict.js.dbg.baseline

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"Symbol.toStringTag": "string global"
55
},
66
"locals": {
7-
"a": "number 1"
7+
"a": "number 1",
8+
"Symbol.toStringTag": "string global"
89
},
910
"globals": {}
1011
}

test/DebuggerCommon/ES6_letconst_eval_strict_fn.js.dbg.baseline

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"a": "number 1"
1515
},
1616
"globals": {
17+
"Symbol.toStringTag": "string global",
1718
"Run": "function <large string>"
1819
}
1920
},

test/DebuggerCommon/ES6_letconst_for.js.dbg.baseline

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"this": "Object {...}",
44
"locals": {
55
"y": "number 1",
6+
"Symbol.toStringTag": "string global",
67
"x": "number 1"
78
}
89
},
@@ -14,6 +15,7 @@
1415
"locals": {
1516
"z": "number 1",
1617
"y": "number 1",
18+
"Symbol.toStringTag": "string global",
1719
"x": "number 1"
1820
},
1921
"globals": {}
@@ -22,6 +24,7 @@
2224
"this": "Object {...}",
2325
"locals": {
2426
"y": "number 2",
27+
"Symbol.toStringTag": "string global",
2528
"x": "number 1"
2629
}
2730
},
@@ -33,6 +36,7 @@
3336
"locals": {
3437
"z": "number 1",
3538
"y": "number 2",
39+
"Symbol.toStringTag": "string global",
3640
"x": "number 1"
3741
},
3842
"globals": {}
@@ -41,6 +45,7 @@
4145
"this": "Object {...}",
4246
"locals": {
4347
"y": "number 3",
48+
"Symbol.toStringTag": "string global",
4449
"x": "number 1"
4550
}
4651
}

test/DebuggerCommon/ES6_letconst_forin.js.dbg.baseline

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
},
77
"locals": {
88
"y": "string x",
9+
"Symbol.toStringTag": "string global",
910
"a": {
1011
"#__proto__": "Object {...}",
1112
"x": "number 2",
@@ -21,6 +22,7 @@
2122
},
2223
"locals": {
2324
"y": "string y",
25+
"Symbol.toStringTag": "string global",
2426
"a": {
2527
"#__proto__": "Object {...}",
2628
"x": "number 2",

test/DebuggerCommon/ES6_letconst_redcl.js.dbg.baseline

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
"locals": {
1212
"a": "number 100",
13-
"b": "number 200"
13+
"b": "number 200",
14+
"Symbol.toStringTag": "string global"
1415
},
1516
"globals": {}
1617
}

0 commit comments

Comments
 (0)