Browse Source

Bug testcase for JSON.parse() positive exponent

api-get-refcount
Sami Vaarala 10 years ago
parent
commit
67a70ecb3f
  1. 30
      ecmascript-testcases/test-bug-json-parse-posexpt.js

30
ecmascript-testcases/test-bug-json-parse-posexpt.js

@ -0,0 +1,30 @@
/*
* JSON number parsing bug in Duktape 1.0 for explicitly positive exponents,
* eval() works.
*/
/*===
150
150
===*/
function testJson() {
// The parse error here is caused by the exponent plus sign.
print(JSON.parse('1.50e+2'));
}
function testEval() {
print(eval('1.50e+2'));
}
try {
testJson();
} catch (e) {
print(e.stack || e);
}
try {
testEval();
} catch (e) {
print(e.stack || e);
}
Loading…
Cancel
Save