From 1d623d2c17745020829b2546fce90e2aa040383c Mon Sep 17 00:00:00 2001 From: Shaofei Cheng Date: Tue, 6 Mar 2012 18:19:46 +0800 Subject: [PATCH 1/2] remove extended grammar --- jsonplus.js | 123 ++++++---------------------------------------------- 1 file changed, 13 insertions(+), 110 deletions(-) diff --git a/jsonplus.js b/jsonplus.js index e337ec8..b9c0da8 100644 --- a/jsonplus.js +++ b/jsonplus.js @@ -13,7 +13,6 @@ JSONObject : { JSONMemberList } JSONMember : JSONString : JSONValue - JSONString : JSONPath JSONMemberList : JSONMember JSONMemberList , JSONMember @@ -59,27 +58,21 @@ function stringifyEx (value,replacer,space) { var objectStack = []; - var pathStack = []; function serializeObject(v) { - path = ""; + for(var i = 0; i < objectStack.length; i++) { if(objectStack[i]==v) { - if(path=="") path ="/"; - return "path("+path+")"; + throw new TypeError("Converting circular structure to JSON"); } - else - path += "/" + pathStack[i]; } objectStack.push(v); holder = v; var result = []; + for(var p in v) { - property = p; if(v.hasOwnProperty(p) && (!propertyIndex || propertyIndex.hasOwnProperty(p))) { - pathStack.push(p); var c = serialize(v[p]); - pathStack.pop(); if(c!==undefined) { result.push(serializeString(p)+":"+(space?" ":"")+c); } @@ -87,7 +80,9 @@ function stringifyEx (value,replacer,space) { } var indent = Array(objectStack.length+1).join(space); var dedent = Array(objectStack.length).join(space); + objectStack.pop(); + if(!result.length) return "{}"; return "{"+(space?"\n"+indent:"")+result.join(","+(space?"\n"+indent:""))+(space?"\n":"")+dedent+"}"; } @@ -95,19 +90,16 @@ function stringifyEx (value,replacer,space) { return undefined; } function serializeArray(v) { - path = ""; + for(var i = 0; i < objectStack.length; i++) { if(objectStack[i]==v) { - if(path=="") path ="/"; - return "path("+path+")"; + throw new TypeError("Converting circular structure to JSON"); } - else - path += "/" + pathStack[i]; } objectStack.push(v); + holder = v; var result = []; - holder = v; for(var i = 0; i < v.length; i++) { property = i; var c = serialize(v[i]); @@ -211,13 +203,12 @@ function Parser() { } } var lex = { - JSONInputElement:"||||||", + JSONInputElement:"|||||", JSONWhiteSpace:/[\t\n\r ]+/, JSONString:/"(?:[^\"\\\u0000-\u001F]+|\\[\"\/\\bfnrt]|\\u[0-9a-fA-F]{4})*"/, JSONNumber:/-?(?:[1-9][0-9]*|0)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/, JSONNullLiteral:/null/, JSONBooleanLiteral:/true|false/, - JSONPath:/path\(\.{0,2}(?:\/(?:(?:"(?:[^\"\\\u0000-\u001F]+|\\[\"\/\\bfnrt]|\\u[0-9a-fA-F]{4})*")|[^/]+)|\/)+\)/, JSONPunctuator:/[\:\[\]\{\}\,]/ } var jsonInputElement = new XRegExp(lex,"JSONInputElement","g"); @@ -242,7 +233,7 @@ function Parser() { } } function SyntacticalParser() { - var ruletext = "JSONText :\nJSONValue\nJSONValue :\nJSONNullLiteral\nJSONBooleanLiteral\nJSONObject\nJSONArray\nJSONString\nJSONNumber\nJSONObject :\n{ } \n{ JSONMemberList }\nJSONMember :\nJSONString : JSONValue\nJSONString : JSONPath\nJSONMemberList :\nJSONMember\nJSONMemberList , JSONMember\nJSONArray :\n[ ]\n[ JSONElementList ]\nJSONElementList :\nJSONValue\nJSONElementList , JSONValue" + var ruletext = "JSONText :\nJSONValue\nJSONValue :\nJSONNullLiteral\nJSONBooleanLiteral\nJSONObject\nJSONArray\nJSONString\nJSONNumber\nJSONObject :\n{ } \n{ JSONMemberList }\nJSONMember :\nJSONString : JSONValue\nJSONMemberList :\nJSONMember\nJSONMemberList , JSONMember\nJSONArray :\n[ ]\n[ JSONElementList ]\nJSONElementList :\nJSONValue\nJSONElementList , JSONValue" ruletext= ruletext.split("\n"); var rules = {}; var currentRule ; @@ -348,7 +339,7 @@ function Parser() { } this.lexicalParser = new LexicalParser(); this.syntacticalParser = new SyntacticalParser(this.lexicalParser); - var terminalSymbols = ["JSONPath","JSONString","JSONNumber","JSONNullLiteral","JSONBooleanLiteral","{","}","[","]",":",","]; + var terminalSymbols = ["JSONString","JSONNumber","JSONNullLiteral","JSONBooleanLiteral","{","}","[","]",":",","]; var terminalSymbolIndex = {}; for(var i = 0; i< terminalSymbols.length; i++) terminalSymbolIndex[terminalSymbols[i]] = undefined; @@ -382,94 +373,16 @@ function Parser() { new SyntaxError("Unexpected token " + token); } } - context = new Context(); return this.evaluate(this.syntacticalParser.getGrammarTree()); } - function Reference(base,propertyname) { - this.base = base; - this.propertyName = propertyname; - } - - function Context(){ - this.statusStack = [{}]; - this.pathStack = [] - this.resolvePath = function (path) { - var path = path.split("/"); - if(path[0] == "") { - var target = this.statusStack[0]; - } - if(path[0]=="."){ - var target = this.statusStack[this.statusStack.length-2]; - } - if(path[0]==".."){ - var target = this.statusStack[this.statusStack.length-3]; - if(!target) - debugger; - } - - var targetStack =[target]; - - for(var i = 1;i< path.length; i++) { - if(path[i]=="") - continue; - if(path[i]==".."){ - targetStack.pop(); - target = targetStack[targetStack.length-1]; - continue; - } - if(path[i]=="."){ - continue; - } - - if(!target["_"+path[i]]) - target["_"+path[i]] = {}; - - target = target["_"+path[i]]; - targetStack.push(target); - } - - - - if(target.value) - return target.value; - else if(target.listener) - target.listener.push(new Reference(this.statusStack[this.statusStack.length-2].value,this.pathStack[this.pathStack.length-1])); - else - target.listener = [ new Reference(this.statusStack[this.statusStack.length-2].value,this.pathStack[this.pathStack.length-1]) ]; - } - this.enter = function (name) { - this.pathStack.push(name); - if(!this.statusStack[this.statusStack.length-1]["_"+name]) - this.statusStack[this.statusStack.length-1]["_"+name] ={}; - this.statusStack.push(this.statusStack[this.statusStack.length-1]["_"+name]); - } - this.quit = function(){ - this.pathStack.pop(); - this.statusStack.pop(); - } - this.register = function (obj) { - this.statusStack[this.statusStack.length-1].value = obj; - - if(this.statusStack[this.statusStack.length-1].listener) - { - for(var i = 0;i Date: Tue, 6 Mar 2012 22:12:22 +0800 Subject: [PATCH 2/2] update tests and fix bugs --- jsonplus.js | 32 +++++++++++-------------------- test/test.htm | 1 + test/test262/15.12.1.1-0-1.js | 2 +- test/test262/15.12.1.1-0-2.js | 4 ++-- test/test262/15.12.1.1-0-3.js | 4 ++-- test/test262/15.12.1.1-0-4.js | 4 ++-- test/test262/15.12.1.1-0-5.js | 4 ++-- test/test262/15.12.1.1-0-6.js | 4 ++-- test/test262/15.12.1.1-0-7.js | 4 ++-- test/test262/15.12.1.1-0-8.js | 4 ++-- test/test262/15.12.1.1-0-9.js | 2 +- test/test262/15.12.1.1-g1-1.js | 6 +++--- test/test262/15.12.1.1-g1-2.js | 4 ++-- test/test262/15.12.1.1-g1-3.js | 4 ++-- test/test262/15.12.1.1-g1-4.js | 4 ++-- test/test262/15.12.1.1-g2-1.js | 2 +- test/test262/15.12.1.1-g2-2.js | 2 +- test/test262/15.12.1.1-g2-3.js | 2 +- test/test262/15.12.1.1-g2-4.js | 2 +- test/test262/15.12.1.1-g2-5.js | 2 +- test/test262/15.12.1.1-g4-1.js | 4 ++-- test/test262/15.12.1.1-g4-2.js | 4 ++-- test/test262/15.12.1.1-g4-3.js | 4 ++-- test/test262/15.12.1.1-g4-4.js | 2 +- test/test262/15.12.1.1-g5-1.js | 2 +- test/test262/15.12.1.1-g5-2.js | 2 +- test/test262/15.12.1.1-g5-3.js | 2 +- test/test262/15.12.1.1-g6-1.js | 2 +- test/test262/15.12.1.1-g6-2.js | 2 +- test/test262/15.12.1.1-g6-3.js | 2 +- test/test262/15.12.1.1-g6-4.js | 2 +- test/test262/15.12.1.1-g6-5.js | 2 +- test/test262/15.12.1.1-g6-6.js | 2 +- test/test262/15.12.1.1-g6-7.js | 2 +- test/test262/15.12.3-0-1.js | 4 ++-- test/test262/15.12.3-0-2.js | 4 ++-- test/test262/15.12.3-0-3.js | 2 +- test/test262/15.12.3-11-1.js | 4 ++-- test/test262/15.12.3-11-10.js | 4 ++-- test/test262/15.12.3-11-11.js | 4 ++-- test/test262/15.12.3-11-12.js | 4 ++-- test/test262/15.12.3-11-13.js | 4 ++-- test/test262/15.12.3-11-14.js | 4 ++-- test/test262/15.12.3-11-15.js | 4 ++-- test/test262/15.12.3-11-2.js | 4 ++-- test/test262/15.12.3-11-3.js | 4 ++-- test/test262/15.12.3-11-4.js | 4 ++-- test/test262/15.12.3-11-5.js | 4 ++-- test/test262/15.12.3-11-6.js | 4 ++-- test/test262/15.12.3-11-7.js | 4 ++-- test/test262/15.12.3-11-8.js | 4 ++-- test/test262/15.12.3-11-9.js | 4 ++-- test/test262/15.12.3-4-1.js | 4 ++-- test/test262/15.12.3-5-a-i-1.js | 4 ++-- test/test262/15.12.3-5-b-i-1.js | 4 ++-- test/test262/15.12.3-6-a-1.js | 4 ++-- test/test262/15.12.3-6-a-2.js | 4 ++-- test/test262/15.12.3-6-b-1.js | 4 ++-- test/test262/15.12.3-6-b-2.js | 4 ++-- test/test262/15.12.3-6-b-3.js | 4 ++-- test/test262/15.12.3-6-b-4.js | 4 ++-- test/test262/15.12.3-7-a-1.js | 4 ++-- test/test262/15.12.3-8-a-1.js | 4 ++-- test/test262/15.12.3-8-a-2.js | 4 ++-- test/test262/15.12.3-8-a-3.js | 4 ++-- test/test262/15.12.3-8-a-4.js | 4 ++-- test/test262/15.12.3-8-a-5.js | 4 ++-- test/test262/15.12.3_2-2-b-i-1.js | 4 ++-- test/test262/15.12.3_2-2-b-i-2.js | 4 ++-- test/test262/15.12.3_2-2-b-i-3.js | 4 ++-- test/test262/15.12.3_2-3-a-1.js | 4 ++-- test/test262/15.12.3_2-3-a-2.js | 4 ++-- test/test262/15.12.3_2-3-a-3.js | 4 ++-- test/test262/15.12.3_4-1-1.js | 4 ++-- test/test262/15.12.3_4-1-2.js | 4 ++-- test/test262/15.12.3_4-1-3.js | 4 ++-- 76 files changed, 142 insertions(+), 151 deletions(-) diff --git a/jsonplus.js b/jsonplus.js index b9c0da8..c2e1582 100644 --- a/jsonplus.js +++ b/jsonplus.js @@ -161,15 +161,13 @@ function stringifyEx (value,replacer,space) { return serialize(value); } -if(JSON) - JSON.stringifyEx = stringifyEx; -else { - this.JSON.stringify = function stringif(v){ - return stringifyEx(v); - }; - this.JSON.stringifyEx = stringifyEx; +if(!this.JSON) { + this.JSON = {}; } - +if(!this.JSON.stringify) + this.JSON.stringify = function stringif(value,replacer,space){ + return stringifyEx.apply(this,arguments); + }; function Parser() { function LexicalParser() { @@ -459,21 +457,13 @@ function Parser() { var parser = new Parser(); -if(JSON) - JSON.parseEx = function(source){ - return parser.parse(source); - } -else { +if(!this.JSON ) { + this.JSON = {}; +} + +if(!this.JSON.parse) this.JSON.parse = function parse(source){ return parser.parse(source); }; - this.JSON.parseEx = function parseEx(source){ - return parser.parse(source); - }; -} - - - - }(); \ No newline at end of file diff --git a/test/test.htm b/test/test.htm index 2e4c2f5..570d845 100644 --- a/test/test.htm +++ b/test/test.htm @@ -70,6 +70,7 @@ logResult(test, result ? 'pass' : 'fail'); } } + delete window.JSON;

Test Page

diff --git a/test/test262/15.12.1.1-0-1.js b/test/test262/15.12.1.1-0-1.js index 93d594d..b5fa5d7 100644 --- a/test/test262/15.12.1.1-0-1.js +++ b/test/test262/15.12.1.1-0-1.js @@ -4,7 +4,7 @@ registerTest( "The JSON lexical grammar treats whitespace as a token seperator", function testcase() { try { - JSON.parseEx('12\t\r\n 34'); // should produce a syntax error as whitespace results in two tokens + JSON.parse('12\t\r\n 34'); // should produce a syntax error as whitespace results in two tokens } catch (e) { if (e.name === 'SyntaxError') return true; diff --git a/test/test262/15.12.1.1-0-2.js b/test/test262/15.12.1.1-0-2.js index 618dbf7..153a2f3 100644 --- a/test/test262/15.12.1.1-0-2.js +++ b/test/test262/15.12.1.1-0-2.js @@ -4,10 +4,10 @@ registerTest( " is not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\u000b1234'); // should produce a syntax error + JSON.parse('\u000b1234'); // should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-3.js b/test/test262/15.12.1.1-0-3.js index 0d49537..fffb11a 100644 --- a/test/test262/15.12.1.1-0-3.js +++ b/test/test262/15.12.1.1-0-3.js @@ -4,10 +4,10 @@ registerTest( " is not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\u000c1234'); // should produce a syntax error + JSON.parse('\u000c1234'); // should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-4.js b/test/test262/15.12.1.1-0-4.js index 76a1ca4..3f332c9 100644 --- a/test/test262/15.12.1.1-0-4.js +++ b/test/test262/15.12.1.1-0-4.js @@ -4,10 +4,10 @@ registerTest( " is not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\u00a01234'); // should produce a syntax error + JSON.parse('\u00a01234'); // should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-5.js b/test/test262/15.12.1.1-0-5.js index 8c1bec7..2e7515f 100644 --- a/test/test262/15.12.1.1-0-5.js +++ b/test/test262/15.12.1.1-0-5.js @@ -4,10 +4,10 @@ registerTest( " is not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\u200b1234'); // should produce a syntax error + JSON.parse('\u200b1234'); // should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-6.js b/test/test262/15.12.1.1-0-6.js index 56720a5..780fbb8 100644 --- a/test/test262/15.12.1.1-0-6.js +++ b/test/test262/15.12.1.1-0-6.js @@ -4,10 +4,10 @@ registerTest( " is not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\ufeff1234'); // should produce a syntax error a + JSON.parse('\ufeff1234'); // should produce a syntax error a } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-7.js b/test/test262/15.12.1.1-0-7.js index 6d53fb6..eef9269 100644 --- a/test/test262/15.12.1.1-0-7.js +++ b/test/test262/15.12.1.1-0-7.js @@ -5,10 +5,10 @@ registerTest( function testcase() { try { // the following should produce a syntax error - JSON.parseEx('\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u30001234'); + JSON.parse('\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u30001234'); } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-8.js b/test/test262/15.12.1.1-0-8.js index f227f6c..b50ab8d 100644 --- a/test/test262/15.12.1.1-0-8.js +++ b/test/test262/15.12.1.1-0-8.js @@ -4,10 +4,10 @@ registerTest( "U+2028 and U+2029 are not valid JSON whitespace as specified by the production JSONWhitespace.", function testcase() { try { - JSON.parseEx('\u2028\u20291234'); // should produce a syntax error + JSON.parse('\u2028\u20291234'); // should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-0-9.js b/test/test262/15.12.1.1-0-9.js index c7101a2..ffb1746 100644 --- a/test/test262/15.12.1.1-0-9.js +++ b/test/test262/15.12.1.1-0-9.js @@ -3,7 +3,7 @@ registerTest( "15.12.1.1-0-9.js", "Whitespace characters can appear before/after any JSONtoken", function testcase() { - JSON.parseEx('\t\r \n{\t\r \n' + + JSON.parse('\t\r \n{\t\r \n' + '"property"\t\r \n:\t\r \n{\t\r \n}\t\r \n,\t\r \n' + '"prop2"\t\r \n:\t\r \n' + '[\t\r \ntrue\t\r \n,\t\r \nnull\t\r \n,123.456\t\r \n]' + diff --git a/test/test262/15.12.1.1-g1-1.js b/test/test262/15.12.1.1-g1-1.js index 60b90ef..648c1d1 100644 --- a/test/test262/15.12.1.1-g1-1.js +++ b/test/test262/15.12.1.1-g1-1.js @@ -3,12 +3,12 @@ registerTest( "15.12.1.1-g1-1.js", "The JSON lexical grammar treats as a whitespace character", function testcase() { - if (JSON.parseEx('\t1234') !== 1234) return false; // should be ignored + if (JSON.parse('\t1234') !== 1234) return false; // should be ignored try { - JSON.parseEx('12\t34'); // should produce a syntax error as whitespace results in two tokens + JSON.parse('12\t34'); // should produce a syntax error as whitespace results in two tokens } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g1-2.js b/test/test262/15.12.1.1-g1-2.js index cc94f62..30c3315 100644 --- a/test/test262/15.12.1.1-g1-2.js +++ b/test/test262/15.12.1.1-g1-2.js @@ -3,9 +3,9 @@ registerTest( "15.12.1.1-g1-2.js", "The JSON lexical grammar treats as a whitespace character", function testcase() { - if (JSON.parseEx('\r1234') !== 1234) return false; // should be ignored + if (JSON.parse('\r1234') !== 1234) return false; // should be ignored try { - JSON.parseEx('12\r34'); // should produce a syntax error as whitespace results in two tokens + JSON.parse('12\r34'); // should produce a syntax error as whitespace results in two tokens } catch (e) { if (e.name === 'SyntaxError') return true; diff --git a/test/test262/15.12.1.1-g1-3.js b/test/test262/15.12.1.1-g1-3.js index d03b74c..b3a996d 100644 --- a/test/test262/15.12.1.1-g1-3.js +++ b/test/test262/15.12.1.1-g1-3.js @@ -3,9 +3,9 @@ registerTest( "15.12.1.1-g1-3.js", "The JSON lexical grammar treats as a whitespace character", function testcase() { - if (JSON.parseEx('\n1234') !== 1234) return false; // should be ignored + if (JSON.parse('\n1234') !== 1234) return false; // should be ignored try { - JSON.parseEx('12\n34'); // should produce a syntax error as whitespace results in two tokens + JSON.parse('12\n34'); // should produce a syntax error as whitespace results in two tokens } catch (e) { if (e.name === 'SyntaxError') return true; diff --git a/test/test262/15.12.1.1-g1-4.js b/test/test262/15.12.1.1-g1-4.js index 684156e..389d623 100644 --- a/test/test262/15.12.1.1-g1-4.js +++ b/test/test262/15.12.1.1-g1-4.js @@ -3,9 +3,9 @@ registerTest( "15.12.1.1-g1-4.js", "The JSON lexical grammar treats as a whitespace character", function testcase() { - if (JSON.parseEx(' 1234') != 1234) return false; // should be ignored + if (JSON.parse(' 1234') != 1234) return false; // should be ignored try { - JSON.parseEx('12 34'); // should produce a syntax error as whitespace results in two tokens + JSON.parse('12 34'); // should produce a syntax error as whitespace results in two tokens } catch (e) { if (e.name === 'SyntaxError') return true; diff --git a/test/test262/15.12.1.1-g2-1.js b/test/test262/15.12.1.1-g2-1.js index 4b8de4a..bbb4c7e 100644 --- a/test/test262/15.12.1.1-g2-1.js +++ b/test/test262/15.12.1.1-g2-1.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g2-1.js", "JSON Strings can be written using double quotes", function testcase() { - return JSON.parseEx('"abc"') === "abc"; + return JSON.parse('"abc"') === "abc"; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g2-2.js b/test/test262/15.12.1.1-g2-2.js index bdd94d0..f28f2ea 100644 --- a/test/test262/15.12.1.1-g2-2.js +++ b/test/test262/15.12.1.1-g2-2.js @@ -4,7 +4,7 @@ registerTest( "A JSON String may not be delimited by single quotes ", function testcase() { try { - if (JSON.parseEx("'abc'") === 'abc') return false; + if (JSON.parse("'abc'") === 'abc') return false; } catch (e) { return true; diff --git a/test/test262/15.12.1.1-g2-3.js b/test/test262/15.12.1.1-g2-3.js index 1aa849a..5034d78 100644 --- a/test/test262/15.12.1.1-g2-3.js +++ b/test/test262/15.12.1.1-g2-3.js @@ -4,7 +4,7 @@ registerTest( "A JSON String may not be delimited by Uncode escaped quotes ", function testcase() { try { - if (JSON.parseEx("\\u0022abc\\u0022") === 'abc') return false; + if (JSON.parse("\\u0022abc\\u0022") === 'abc') return false; } catch (e) { return true; diff --git a/test/test262/15.12.1.1-g2-4.js b/test/test262/15.12.1.1-g2-4.js index 556a11b..c73fd8c 100644 --- a/test/test262/15.12.1.1-g2-4.js +++ b/test/test262/15.12.1.1-g2-4.js @@ -4,7 +4,7 @@ registerTest( "A JSONString must both begin and end with double quotes", function testcase() { try { - if (JSON.parseEx('"ab' + "c'") === 'abc') return false; + if (JSON.parse('"ab' + "c'") === 'abc') return false; } catch (e) { return true; diff --git a/test/test262/15.12.1.1-g2-5.js b/test/test262/15.12.1.1-g2-5.js index da3832e..4f8f424 100644 --- a/test/test262/15.12.1.1-g2-5.js +++ b/test/test262/15.12.1.1-g2-5.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g2-5.js", "A JSONStrings can contain no JSONStringCharacters (Empty JSONStrings)", function testcase() { - return JSON.parseEx('""') === ""; + return JSON.parse('""') === ""; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g4-1.js b/test/test262/15.12.1.1-g4-1.js index 4d0d934..23a27b7 100644 --- a/test/test262/15.12.1.1-g4-1.js +++ b/test/test262/15.12.1.1-g4-1.js @@ -4,10 +4,10 @@ registerTest( "The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0000 thru U+0007", function testcase() { try { - JSON.parseEx('"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007"'); // invalid string characters should produce a syntax error + JSON.parse('"\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007"'); // invalid string characters should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g4-2.js b/test/test262/15.12.1.1-g4-2.js index e8df2fc..c724fda 100644 --- a/test/test262/15.12.1.1-g4-2.js +++ b/test/test262/15.12.1.1-g4-2.js @@ -4,10 +4,10 @@ registerTest( "The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0008 thru U+000F", function testcase() { try { - JSON.parseEx('"\u0008\u0009\u000a\u000b\u000c\u000d\u000e\u000f"'); // invalid string characters should produce a syntax error + JSON.parse('"\u0008\u0009\u000a\u000b\u000c\u000d\u000e\u000f"'); // invalid string characters should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g4-3.js b/test/test262/15.12.1.1-g4-3.js index ce61943..311d84a 100644 --- a/test/test262/15.12.1.1-g4-3.js +++ b/test/test262/15.12.1.1-g4-3.js @@ -4,10 +4,10 @@ registerTest( "The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0010 thru U+0017", function testcase() { try { - JSON.parseEx('"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"'); // invalid string characters should produce a syntax error + JSON.parse('"\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017"'); // invalid string characters should produce a syntax error } catch (e) { - return true; // treat any exception as a pass, other tests ensure that JSON.parseEx throws SyntaxError exceptions + return true; // treat any exception as a pass, other tests ensure that JSON.parse throws SyntaxError exceptions } } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g4-4.js b/test/test262/15.12.1.1-g4-4.js index dea42f6..0deab7d 100644 --- a/test/test262/15.12.1.1-g4-4.js +++ b/test/test262/15.12.1.1-g4-4.js @@ -4,7 +4,7 @@ registerTest( "The JSON lexical grammar does not allow a JSONStringCharacter to be any of the Unicode characters U+0018 thru U+001F", function testcase() { try { - JSON.parseEx('"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"'); // invalid string characters should produce a syntax error + JSON.parse('"\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f"'); // invalid string characters should produce a syntax error } catch (e) { if (e.name === 'SyntaxError') return true; diff --git a/test/test262/15.12.1.1-g5-1.js b/test/test262/15.12.1.1-g5-1.js index 40dae49..25130b5 100644 --- a/test/test262/15.12.1.1-g5-1.js +++ b/test/test262/15.12.1.1-g5-1.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g5-1.js", "The JSON lexical grammar allows Unicode escape sequences in a JSONString", function testcase() { - return JSON.parseEx('"\\u0058"') === 'X'; + return JSON.parse('"\\u0058"') === 'X'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g5-2.js b/test/test262/15.12.1.1-g5-2.js index 7f4a3cf..ff44336 100644 --- a/test/test262/15.12.1.1-g5-2.js +++ b/test/test262/15.12.1.1-g5-2.js @@ -4,7 +4,7 @@ registerTest( "A JSONStringCharacter UnicodeEscape may not have fewer than 4 hex characters", function testcase() { try { - JSON.parseEx('"\\u005"') + JSON.parse('"\\u005"') } catch (e) { return e.name === 'SyntaxError' diff --git a/test/test262/15.12.1.1-g5-3.js b/test/test262/15.12.1.1-g5-3.js index 12ba2d9..f258713 100644 --- a/test/test262/15.12.1.1-g5-3.js +++ b/test/test262/15.12.1.1-g5-3.js @@ -4,7 +4,7 @@ registerTest( "A JSONStringCharacter UnicodeEscape may not include any non=hex characters", function testcase() { try { - JSON.parseEx('"\\u0X50"') + JSON.parse('"\\u0X50"') } catch (e) { return e.name === 'SyntaxError' diff --git a/test/test262/15.12.1.1-g6-1.js b/test/test262/15.12.1.1-g6-1.js index 1ee4128..47d7bbe 100644 --- a/test/test262/15.12.1.1-g6-1.js +++ b/test/test262/15.12.1.1-g6-1.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-1.js", "The JSON lexical grammer allows '/' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\/"') === '/'; + return JSON.parse('"\\/"') === '/'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-2.js b/test/test262/15.12.1.1-g6-2.js index a173ced..665ac56 100644 --- a/test/test262/15.12.1.1-g6-2.js +++ b/test/test262/15.12.1.1-g6-2.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-2.js", "The JSON lexical grammer allows '\' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\\\"') === '\\'; + return JSON.parse('"\\\\"') === '\\'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-3.js b/test/test262/15.12.1.1-g6-3.js index d389465..a0c3f1a 100644 --- a/test/test262/15.12.1.1-g6-3.js +++ b/test/test262/15.12.1.1-g6-3.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-3.js", "The JSON lexical grammer allows 'b' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\b"') === '\b'; + return JSON.parse('"\\b"') === '\b'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-4.js b/test/test262/15.12.1.1-g6-4.js index 71ef834..6895a57 100644 --- a/test/test262/15.12.1.1-g6-4.js +++ b/test/test262/15.12.1.1-g6-4.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-4.js", "The JSON lexical grammer allows 'f' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\f"') === '\f'; + return JSON.parse('"\\f"') === '\f'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-5.js b/test/test262/15.12.1.1-g6-5.js index 71d9622..d60db02 100644 --- a/test/test262/15.12.1.1-g6-5.js +++ b/test/test262/15.12.1.1-g6-5.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-5.js", "The JSON lexical grammer allows 'n' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\n"') === '\n'; + return JSON.parse('"\\n"') === '\n'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-6.js b/test/test262/15.12.1.1-g6-6.js index d210578..da9296c 100644 --- a/test/test262/15.12.1.1-g6-6.js +++ b/test/test262/15.12.1.1-g6-6.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-6.js", "The JSON lexical grammer allows 'r' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\r"') === '\r'; + return JSON.parse('"\\r"') === '\r'; } ); \ No newline at end of file diff --git a/test/test262/15.12.1.1-g6-7.js b/test/test262/15.12.1.1-g6-7.js index 84369c1..f882ffb 100644 --- a/test/test262/15.12.1.1-g6-7.js +++ b/test/test262/15.12.1.1-g6-7.js @@ -3,6 +3,6 @@ registerTest( "15.12.1.1-g6-7.js", "The JSON lexical grammer allows 't' as a JSONEscapeCharacter after '\' in a JSONString", function testcase() { - return JSON.parseEx('"\\t"') === '\t'; + return JSON.parse('"\\t"') === '\t'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-0-1.js b/test/test262/15.12.3-0-1.js index 7103c57..8ce5586 100644 --- a/test/test262/15.12.3-0-1.js +++ b/test/test262/15.12.3-0-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-0-1.js", - "JSON.stringifyEx must exist as be a function", + "JSON.stringify must exist as be a function", function testcase() { - var f = JSON.stringifyEx; + var f = JSON.stringify; if (typeof (f) === "function") { return true; } diff --git a/test/test262/15.12.3-0-2.js b/test/test262/15.12.3-0-2.js index aee7335..71a6da0 100644 --- a/test/test262/15.12.3-0-2.js +++ b/test/test262/15.12.3-0-2.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-0-2.js", - "JSON.stringifyEx must exist as be a function taking 3 parameters", + "JSON.stringify must exist as be a function taking 3 parameters", function testcase() { - var f = JSON.stringifyEx; + var f = JSON.stringify; if (typeof (f) === "function" && f.length === 3) { return true; diff --git a/test/test262/15.12.3-0-3.js b/test/test262/15.12.3-0-3.js index ff1b824..66f4249 100644 --- a/test/test262/15.12.3-0-3.js +++ b/test/test262/15.12.3-0-3.js @@ -1,7 +1,7 @@ registerTest( "15.12.3", "15.12.3-0-3.js", - "JSON.stringifyEx must be deletable (configurable)", + "JSON.stringify must be deletable (configurable)", function testcase() { var o = JSON; var desc = Object.getOwnPropertyDescriptor(o, "stringify"); diff --git a/test/test262/15.12.3-11-1.js b/test/test262/15.12.3-11-1.js index ce32601..0166805 100644 --- a/test/test262/15.12.3-11-1.js +++ b/test/test262/15.12.3-11-1.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-1.js", - "JSON.stringifyEx(undefined) returns undefined", + "JSON.stringify(undefined) returns undefined", function testcase() { - return JSON.stringifyEx(undefined) === undefined; + return JSON.stringify(undefined) === undefined; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-10.js b/test/test262/15.12.3-11-10.js index ffa9291..f7253c1 100644 --- a/test/test262/15.12.3-11-10.js +++ b/test/test262/15.12.3-11-10.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-10.js", - "A JSON.stringifyEx replacer function applied to a top level scalar value can return undefined.", + "A JSON.stringify replacer function applied to a top level scalar value can return undefined.", function testcase() { - return JSON.stringifyEx(42, function (k, v) { return undefined }) === undefined; + return JSON.stringify(42, function (k, v) { return undefined }) === undefined; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-11.js b/test/test262/15.12.3-11-11.js index a5a6da4..634d29c 100644 --- a/test/test262/15.12.3-11-11.js +++ b/test/test262/15.12.3-11-11.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-11.js", - "A JSON.stringifyEx replacer function applied to a top level Object can return undefined.", + "A JSON.stringify replacer function applied to a top level Object can return undefined.", function testcase() { - return JSON.stringifyEx({ prop: 1 }, function (k, v) { return undefined }) === undefined; + return JSON.stringify({ prop: 1 }, function (k, v) { return undefined }) === undefined; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-12.js b/test/test262/15.12.3-11-12.js index 952cb18..e937f21 100644 --- a/test/test262/15.12.3-11-12.js +++ b/test/test262/15.12.3-11-12.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-12.js", - "A JSON.stringifyEx replacer function applied to a top level scalar can return an Array.", + "A JSON.stringify replacer function applied to a top level scalar can return an Array.", function testcase() { - return JSON.stringifyEx(42, function (k, v) { return v == 42 ? [4, 2] : v }) === '[4,2]'; + return JSON.stringify(42, function (k, v) { return v == 42 ? [4, 2] : v }) === '[4,2]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-13.js b/test/test262/15.12.3-11-13.js index 7128a63..8842858 100644 --- a/test/test262/15.12.3-11-13.js +++ b/test/test262/15.12.3-11-13.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-13.js", - "A JSON.stringifyEx replacer function applied to a top level scalar can return an Object.", + "A JSON.stringify replacer function applied to a top level scalar can return an Object.", function testcase() { - return JSON.stringifyEx(42, function (k, v) { return v == 42 ? { forty: 2} : v }) === '{"forty":2}'; + return JSON.stringify(42, function (k, v) { return v == 42 ? { forty: 2} : v }) === '{"forty":2}'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-14.js b/test/test262/15.12.3-11-14.js index d16e967..0c74da9 100644 --- a/test/test262/15.12.3-11-14.js +++ b/test/test262/15.12.3-11-14.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-14.js", - "Applying JSON.stringifyEx to a function returns undefined.", + "Applying JSON.stringify to a function returns undefined.", function testcase() { - return JSON.stringifyEx(function () { }) === undefined; + return JSON.stringify(function () { }) === undefined; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-15.js b/test/test262/15.12.3-11-15.js index f0670fb..daf147c 100644 --- a/test/test262/15.12.3-11-15.js +++ b/test/test262/15.12.3-11-15.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-15.js", - "Applying JSON.stringifyEx with a replacer function to a function returns the replacer value.", + "Applying JSON.stringify with a replacer function to a function returns the replacer value.", function testcase() { - return JSON.stringifyEx(function () { }, function (k, v) { return 99 }) === '99'; + return JSON.stringify(function () { }, function (k, v) { return 99 }) === '99'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-2.js b/test/test262/15.12.3-11-2.js index 8c75617..609dcc1 100644 --- a/test/test262/15.12.3-11-2.js +++ b/test/test262/15.12.3-11-2.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-2.js", - "A JSON.stringifyEx replacer function works is applied to a top level undefined value.", + "A JSON.stringify replacer function works is applied to a top level undefined value.", function testcase() { - return JSON.stringifyEx(undefined, function (k, v) { return "replacement" }) === '"replacement"'; + return JSON.stringify(undefined, function (k, v) { return "replacement" }) === '"replacement"'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-3.js b/test/test262/15.12.3-11-3.js index a6c3ea3..6717493 100644 --- a/test/test262/15.12.3-11-3.js +++ b/test/test262/15.12.3-11-3.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-3.js", - "A JSON.stringifyEx correctly works on top level string values.", + "A JSON.stringify correctly works on top level string values.", function testcase() { - return JSON.stringifyEx("a string") === '"a string"'; + return JSON.stringify("a string") === '"a string"'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-4.js b/test/test262/15.12.3-11-4.js index 446cd1c..edd0ae9 100644 --- a/test/test262/15.12.3-11-4.js +++ b/test/test262/15.12.3-11-4.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-4.js", - "JSON.stringifyEx correctly works on top level Number values.", + "JSON.stringify correctly works on top level Number values.", function testcase() { - return JSON.stringifyEx(123) === '123'; + return JSON.stringify(123) === '123'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-5.js b/test/test262/15.12.3-11-5.js index 4684abf..1746e90 100644 --- a/test/test262/15.12.3-11-5.js +++ b/test/test262/15.12.3-11-5.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-5.js", - "JSON.stringifyEx correctly works on top level Boolean values.", + "JSON.stringify correctly works on top level Boolean values.", function testcase() { - return JSON.stringifyEx(true) === 'true'; + return JSON.stringify(true) === 'true'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-6.js b/test/test262/15.12.3-11-6.js index df2fb0a..0bd572c 100644 --- a/test/test262/15.12.3-11-6.js +++ b/test/test262/15.12.3-11-6.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-6.js", - "JSON.stringifyEx correctly works on top level null values.", + "JSON.stringify correctly works on top level null values.", function testcase() { - return JSON.stringifyEx(null) === 'null'; + return JSON.stringify(null) === 'null'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-7.js b/test/test262/15.12.3-11-7.js index 3460718..2b6d31d 100644 --- a/test/test262/15.12.3-11-7.js +++ b/test/test262/15.12.3-11-7.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-7.js", - "JSON.stringifyEx correctly works on top level Number objects.", + "JSON.stringify correctly works on top level Number objects.", function testcase() { - return JSON.stringifyEx(new Number(42)) === '42'; + return JSON.stringify(new Number(42)) === '42'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-8.js b/test/test262/15.12.3-11-8.js index 6f4bb61..b297c63 100644 --- a/test/test262/15.12.3-11-8.js +++ b/test/test262/15.12.3-11-8.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-8.js", - "JSON.stringifyEx correctly works on top level String objects.", + "JSON.stringify correctly works on top level String objects.", function testcase() { - return JSON.stringifyEx(new String('wrappered')) === '"wrappered"'; + return JSON.stringify(new String('wrappered')) === '"wrappered"'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-11-9.js b/test/test262/15.12.3-11-9.js index 654b9b5..86776cd 100644 --- a/test/test262/15.12.3-11-9.js +++ b/test/test262/15.12.3-11-9.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3-11-9.js", - "JSON.stringifyEx correctly works on top level Boolean objects.", + "JSON.stringify correctly works on top level Boolean objects.", function testcase() { - return JSON.stringifyEx(new Boolean(false)) === 'false'; + return JSON.stringify(new Boolean(false)) === 'false'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3-4-1.js b/test/test262/15.12.3-4-1.js index fa194de..1a4341d 100644 --- a/test/test262/15.12.3-4-1.js +++ b/test/test262/15.12.3-4-1.js @@ -1,10 +1,10 @@ registerTest( "15.12.3", "15.12.3-4-1.js", - "JSON.stringifyEx ignores replacer aruguments that are not functions or arrays..", + "JSON.stringify ignores replacer aruguments that are not functions or arrays..", function testcase() { try { - return JSON.stringifyEx([42], {}) === '[42]'; + return JSON.stringify([42], {}) === '[42]'; } catch (e) { return false } } diff --git a/test/test262/15.12.3-5-a-i-1.js b/test/test262/15.12.3-5-a-i-1.js index d087f9c..bcaabb3 100644 --- a/test/test262/15.12.3-5-a-i-1.js +++ b/test/test262/15.12.3-5-a-i-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-5-a-i-1.js", - "JSON.stringifyEx converts Number wrapper object space aruguments to Number values", + "JSON.stringify converts Number wrapper object space aruguments to Number values", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, new Number(5)) === JSON.stringifyEx(obj, null, 5); + return JSON.stringify(obj, null, new Number(5)) === JSON.stringify(obj, null, 5); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-5-b-i-1.js b/test/test262/15.12.3-5-b-i-1.js index 04ac77b..15754d8 100644 --- a/test/test262/15.12.3-5-b-i-1.js +++ b/test/test262/15.12.3-5-b-i-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-5-b-i-1.js", - "JSON.stringifyEx converts String wrapper object space aruguments to String values", + "JSON.stringify converts String wrapper object space aruguments to String values", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, new String('xxx')) === JSON.stringifyEx(obj, null, 'xxx'); + return JSON.stringify(obj, null, new String('xxx')) === JSON.stringify(obj, null, 'xxx'); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-a-1.js b/test/test262/15.12.3-6-a-1.js index 244def1..79500bf 100644 --- a/test/test262/15.12.3-6-a-1.js +++ b/test/test262/15.12.3-6-a-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-6-a-1.js", - "JSON.stringifyEx treats numeric space arguments greater than 10 the same as a space argument of 10.", + "JSON.stringify treats numeric space arguments greater than 10 the same as a space argument of 10.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, 10) === JSON.stringifyEx(obj, null, 100); + return JSON.stringify(obj, null, 10) === JSON.stringify(obj, null, 100); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-a-2.js b/test/test262/15.12.3-6-a-2.js index f9f8618..8c99045 100644 --- a/test/test262/15.12.3-6-a-2.js +++ b/test/test262/15.12.3-6-a-2.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-6-a-2.js", - "JSON.stringifyEx truccates non-integer numeric space arguments to their integer part.", + "JSON.stringify truccates non-integer numeric space arguments to their integer part.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, 5.99999) === JSON.stringifyEx(obj, null, 5); + return JSON.stringify(obj, null, 5.99999) === JSON.stringify(obj, null, 5); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-b-1.js b/test/test262/15.12.3-6-b-1.js index c513fb3..9b23081 100644 --- a/test/test262/15.12.3-6-b-1.js +++ b/test/test262/15.12.3-6-b-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-6-b-1.js", - "JSON.stringifyEx treats numeric space arguments less than 1 (0.999999)the same as emptry string space argument.", + "JSON.stringify treats numeric space arguments less than 1 (0.999999)the same as emptry string space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, 0.999999) === JSON.stringifyEx(obj); /* emptry string should be same as no space arg */ + return JSON.stringify(obj, null, 0.999999) === JSON.stringify(obj); /* emptry string should be same as no space arg */ } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-b-2.js b/test/test262/15.12.3-6-b-2.js index 033d4e9..f0150da 100644 --- a/test/test262/15.12.3-6-b-2.js +++ b/test/test262/15.12.3-6-b-2.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-6-b-2.js", - "JSON.stringifyEx treats numeric space arguments less than 1 (0)the same as emptry string space argument.", + "JSON.stringify treats numeric space arguments less than 1 (0)the same as emptry string space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, 0) === JSON.stringifyEx(obj); /* emptry string should be same as no space arg */ + return JSON.stringify(obj, null, 0) === JSON.stringify(obj); /* emptry string should be same as no space arg */ } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-b-3.js b/test/test262/15.12.3-6-b-3.js index b8c8e7f..f3b17b5 100644 --- a/test/test262/15.12.3-6-b-3.js +++ b/test/test262/15.12.3-6-b-3.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-6-b-3.js", - "JSON.stringifyEx treats numeric space arguments less than 1 (-5) the same as emptry string space argument.", + "JSON.stringify treats numeric space arguments less than 1 (-5) the same as emptry string space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, -5) === JSON.stringifyEx(obj); /* emptry string should be same as no space arg */ + return JSON.stringify(obj, null, -5) === JSON.stringify(obj); /* emptry string should be same as no space arg */ } ); \ No newline at end of file diff --git a/test/test262/15.12.3-6-b-4.js b/test/test262/15.12.3-6-b-4.js index 2fbbc94..fae161e 100644 --- a/test/test262/15.12.3-6-b-4.js +++ b/test/test262/15.12.3-6-b-4.js @@ -1,11 +1,11 @@ registerTest( "15.12.3", "15.12.3-6-b-4.js", - "JSON.stringifyEx treats numeric space arguments (in the range 1..10) is equivalent to a string of spaces of that length.", + "JSON.stringify treats numeric space arguments (in the range 1..10) is equivalent to a string of spaces of that length.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; var fiveSpaces = ' '; // '12345' - return JSON.stringifyEx(obj, null, 5) === JSON.stringifyEx(obj, null, fiveSpaces); + return JSON.stringify(obj, null, 5) === JSON.stringify(obj, null, fiveSpaces); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-7-a-1.js b/test/test262/15.12.3-7-a-1.js index f32715b..300cfc7 100644 --- a/test/test262/15.12.3-7-a-1.js +++ b/test/test262/15.12.3-7-a-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-7-a-1.js", - "JSON.stringifyEx only uses the first 10 characters of a string space arguments.", + "JSON.stringify only uses the first 10 characters of a string space arguments.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj, null, '0123456789xxxxxxxxx') === JSON.stringifyEx(obj, null, '0123456789'); + return JSON.stringify(obj, null, '0123456789xxxxxxxxx') === JSON.stringify(obj, null, '0123456789'); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-8-a-1.js b/test/test262/15.12.3-8-a-1.js index 742eb60..cf301e4 100644 --- a/test/test262/15.12.3-8-a-1.js +++ b/test/test262/15.12.3-8-a-1.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-8-a-1.js", - "JSON.stringifyEx treats an empty string space argument the same as a missing space argument.", + "JSON.stringify treats an empty string space argument the same as a missing space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj) === JSON.stringifyEx(obj, null, ''); + return JSON.stringify(obj) === JSON.stringify(obj, null, ''); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-8-a-2.js b/test/test262/15.12.3-8-a-2.js index d27eb34..4cadda0 100644 --- a/test/test262/15.12.3-8-a-2.js +++ b/test/test262/15.12.3-8-a-2.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-8-a-2.js", - "JSON.stringifyEx treats an Boolean space argument the same as a missing space argument.", + "JSON.stringify treats an Boolean space argument the same as a missing space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj) === JSON.stringifyEx(obj, null, true); + return JSON.stringify(obj) === JSON.stringify(obj, null, true); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-8-a-3.js b/test/test262/15.12.3-8-a-3.js index b56a942..e3514dd 100644 --- a/test/test262/15.12.3-8-a-3.js +++ b/test/test262/15.12.3-8-a-3.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-8-a-3.js", - "JSON.stringifyEx treats an null space argument the same as a missing space argument.", + "JSON.stringify treats an null space argument the same as a missing space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj) === JSON.stringifyEx(obj, null, null); + return JSON.stringify(obj) === JSON.stringify(obj, null, null); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-8-a-4.js b/test/test262/15.12.3-8-a-4.js index b0319a9..97fb9af 100644 --- a/test/test262/15.12.3-8-a-4.js +++ b/test/test262/15.12.3-8-a-4.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-8-a-4.js", - "JSON.stringifyEx treats an Boolean wrapper space argument the same as a missing space argument.", + "JSON.stringify treats an Boolean wrapper space argument the same as a missing space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj) === JSON.stringifyEx(obj, null, new Boolean(true)); + return JSON.stringify(obj) === JSON.stringify(obj, null, new Boolean(true)); } ); \ No newline at end of file diff --git a/test/test262/15.12.3-8-a-5.js b/test/test262/15.12.3-8-a-5.js index c2db9cf..56e82f9 100644 --- a/test/test262/15.12.3-8-a-5.js +++ b/test/test262/15.12.3-8-a-5.js @@ -1,9 +1,9 @@ registerTest( "15.12.3", "15.12.3-8-a-5.js", - "JSON.stringifyEx treats non-Number or String object space arguments the same as a missing space argument.", + "JSON.stringify treats non-Number or String object space arguments the same as a missing space argument.", function testcase() { var obj = { a1: { b1: [1, 2, 3, 4], b2: { c1: 1, c2: 2} }, a2: 'a2' }; - return JSON.stringifyEx(obj) === JSON.stringifyEx(obj, null, obj); + return JSON.stringify(obj) === JSON.stringify(obj, null, obj); } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-2-b-i-1.js b/test/test262/15.12.3_2-2-b-i-1.js index 117f777..457cfcc 100644 --- a/test/test262/15.12.3_2-2-b-i-1.js +++ b/test/test262/15.12.3_2-2-b-i-1.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_2-2-b-i-1.js", - "JSON.stringifyEx converts string wrapper objects returned from a toJSON call to literal strings.", + "JSON.stringify converts string wrapper objects returned from a toJSON call to literal strings.", function testcase() { var obj = { prop: 42, toJSON: function () { return 'fortytwo objects' } }; - return JSON.stringifyEx([obj]) === '["fortytwo objects"]'; + return JSON.stringify([obj]) === '["fortytwo objects"]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-2-b-i-2.js b/test/test262/15.12.3_2-2-b-i-2.js index f90b0be..a2c7639 100644 --- a/test/test262/15.12.3_2-2-b-i-2.js +++ b/test/test262/15.12.3_2-2-b-i-2.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_2-2-b-i-2.js", - "JSON.stringifyEx converts Number wrapper objects returned from a toJSON call to literal Number.", + "JSON.stringify converts Number wrapper objects returned from a toJSON call to literal Number.", function testcase() { var obj = { prop: 42, toJSON: function () { return new Number(42) } }; - return JSON.stringifyEx([obj]) === '[42]'; + return JSON.stringify([obj]) === '[42]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-2-b-i-3.js b/test/test262/15.12.3_2-2-b-i-3.js index 588305c..3f68982 100644 --- a/test/test262/15.12.3_2-2-b-i-3.js +++ b/test/test262/15.12.3_2-2-b-i-3.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_2-2-b-i-3.js", - "JSON.stringifyEx converts Boolean wrapper objects returned from a toJSON call to literal Boolean values.", + "JSON.stringify converts Boolean wrapper objects returned from a toJSON call to literal Boolean values.", function testcase() { var obj = { prop: 42, toJSON: function () { return new Boolean(true) } }; - return JSON.stringifyEx([obj]) === '[true]'; + return JSON.stringify([obj]) === '[true]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-3-a-1.js b/test/test262/15.12.3_2-3-a-1.js index 65077a3..ae7ffb4 100644 --- a/test/test262/15.12.3_2-3-a-1.js +++ b/test/test262/15.12.3_2-3-a-1.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3_2-3-a-1.js", - "JSON.stringifyEx converts string wrapper objects returned from replacer functions to literal strings.", + "JSON.stringify converts string wrapper objects returned from replacer functions to literal strings.", function testcase() { - return JSON.stringifyEx([42], function (k, v) { return v === 42 ? new String('fortytwo') : v }) === '["fortytwo"]'; + return JSON.stringify([42], function (k, v) { return v === 42 ? new String('fortytwo') : v }) === '["fortytwo"]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-3-a-2.js b/test/test262/15.12.3_2-3-a-2.js index 6697ec3..0be989f 100644 --- a/test/test262/15.12.3_2-3-a-2.js +++ b/test/test262/15.12.3_2-3-a-2.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3_2-3-a-2.js", - "JSON.stringifyEx converts Number wrapper objects returned from replacer functions to literal numbers.", + "JSON.stringify converts Number wrapper objects returned from replacer functions to literal numbers.", function testcase() { - return JSON.stringifyEx([42], function (k, v) { return v === 42 ? new Number(84) : v }) === '[84]'; + return JSON.stringify([42], function (k, v) { return v === 42 ? new Number(84) : v }) === '[84]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_2-3-a-3.js b/test/test262/15.12.3_2-3-a-3.js index 54479f7..d6277e4 100644 --- a/test/test262/15.12.3_2-3-a-3.js +++ b/test/test262/15.12.3_2-3-a-3.js @@ -1,8 +1,8 @@ registerTest( "15.12.3", "15.12.3_2-3-a-3.js", - "JSON.stringifyEx converts Boolean wrapper objects returned from replacer functions to literal numbers.", + "JSON.stringify converts Boolean wrapper objects returned from replacer functions to literal numbers.", function testcase() { - return JSON.stringifyEx([42], function (k, v) { return v === 42 ? new Boolean(false) : v }) === '[false]'; + return JSON.stringify([42], function (k, v) { return v === 42 ? new Boolean(false) : v }) === '[false]'; } ); \ No newline at end of file diff --git a/test/test262/15.12.3_4-1-1.js b/test/test262/15.12.3_4-1-1.js index f348be6..0de06c0 100644 --- a/test/test262/15.12.3_4-1-1.js +++ b/test/test262/15.12.3_4-1-1.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_4-1-1.js", - "JSON.stringifyEx a circular object throws a error", + "JSON.stringify a circular object throws a error", function testcase() { var obj = {}; obj.prop = obj; try { - JSON.stringifyEx(obj); + JSON.stringify(obj); return false; // should not reach here } catch (e) { return true } diff --git a/test/test262/15.12.3_4-1-2.js b/test/test262/15.12.3_4-1-2.js index 0299a5b..fb6dcc5 100644 --- a/test/test262/15.12.3_4-1-2.js +++ b/test/test262/15.12.3_4-1-2.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_4-1-2.js", - "JSON.stringifyEx a circular object throws a TypeError", + "JSON.stringify a circular object throws a TypeError", function testcase() { var obj = {}; obj.prop = obj; try { - JSON.stringifyEx(obj); + JSON.stringify(obj); return false; // should not reach here } catch (e) { return e.name === 'TypeError' } diff --git a/test/test262/15.12.3_4-1-3.js b/test/test262/15.12.3_4-1-3.js index 687ca98..90b3a6a 100644 --- a/test/test262/15.12.3_4-1-3.js +++ b/test/test262/15.12.3_4-1-3.js @@ -1,12 +1,12 @@ registerTest( "15.12.3", "15.12.3_4-1-3.js", - "JSON.stringifyEx a indirectly circular object throws a error", + "JSON.stringify a indirectly circular object throws a error", function testcase() { var obj = { p1: { p2: {}} }; obj.p1.p2.prop = obj; try { - JSON.stringifyEx(obj); + JSON.stringify(obj); return false; // should not reach here } catch (e) { return true }