forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspace.js
More file actions
50 lines (44 loc) · 1.59 KB
/
space.js
File metadata and controls
50 lines (44 loc) · 1.59 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
40
41
42
43
44
45
46
47
48
49
50
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
if (this.WScript && this.WScript.LoadScriptFile) { // works for browser
WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
}
var tests = [
{
name: "regress Win8: 690708",
body: function () {
function stringify(o, space) {
var str = JSON.stringify(o, null, space);
var str2 = JSON.stringify(o, null, new Number(space)); // Test Number Object
helpers.writeln("--space: " + space);
helpers.writeln(str);
assert.areEqual(str, str2);
}
var o = { ab: 123 };
var spaces = [
Number.MIN_VALUE,
-4294967296,
-2147483649,
-2147483648, //int32 min
-1073741825,
-1073741824, //int31 min
-28, -7, -1, 0, 1, 6, 15,
1073741823, //int31 max
1073741824,
2147483647, //int32 max
2147483647.1,
2147483648,
2147483648.2,
4294967295, //uint32 max
4294967296,
Number.MAX_VALUE
];
spaces.forEach(function (space) {
stringify(o, space);
});
}
}
];
testRunner.run(tests);