forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjson_parse_Blue_548957.js
More file actions
29 lines (25 loc) · 920 Bytes
/
json_parse_Blue_548957.js
File metadata and controls
29 lines (25 loc) · 920 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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
var passed = true;
try {
JSON.parse("0101");
WScript.Echo("Syntax error expected when parsing 0101.");
passed = false;
} catch (ex) {
if (!(ex instanceof SyntaxError)) {
WScript.Echo("Syntax error expected when parsing 0101. Got - " + ex);
}
}
if (JSON.parse("0.101") !== 0.101) {
WScript.Echo("Incorrectly parsed 0.101.");
passed = false;
};
if (JSON.parse("101") !== 101) {
WScript.Echo("Incorrectly parsed 101.");
passed = false;
};
if (passed) {
WScript.Echo("Pass");
}