Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
39 lines (30 loc) · 1.38 KB

File metadata and controls

39 lines (30 loc) · 1.38 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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.
//-------------------------------------------------------------------------------------------------------
var o = new Array();
var a = new Object();
// Generate getter that will return a constructed string
function propString(i)
{
return function() { var ret = "a" + i; return ret; };
}
function init(o, a)
{
for (var i = 0; i < 21; i++)
{
// Create a replacer array that doesn't hold the string reference by using a getter to create
// the string.
Object.defineProperty(o, i, { get: propString(i) } );
// Initialize the object to be stringify
a["a" + i] = i;
}
}
init(o,a);
WScript.Echo(JSON.stringify(a,o));
// Bug 30349 - invalid replacer array element after valid element causes crash regardless of input
WScript.Echo(JSON.stringify(true, [new Number(1.5), true])); // Original repro
WScript.Echo(JSON.stringify(false, [new Number(1.5), true]));
WScript.Echo(JSON.stringify(null, [new Number(1.5), true]));
// Valid input should just ignore any bad replacer array elements
WScript.Echo(JSON.stringify(a, [false, "a0", true, "a10", false]));
Morty Proxy This is a proxified and sanitized view of the page, visit original site.