Closed Bug 505211 Opened 15 years ago Closed 15 years ago

Add the JSON built-in object

Categories

(Rhino Graveyard :: Core, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rspeyer, Assigned: norrisboyd)

References

Details

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-gb) AppleWebKit/530.18 (KHTML, like Gecko) Version/4.0.1 Safari/530.18
Build Identifier: Rhino 1.7 release 2 2009 03 22

As specified by 15.12 of the EcmaScript 5 spec.

http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft

Reproducible: Always
Blocks: 489326
Assumes existence of of NativeArrayTest, which is added in attachment 386880 [details] [diff] [review] for bug 489329
Cleaned up the code a little and disallowed JSON numbers from starting with 0 unless their entire integral part is just '0'.
Attachment #389460 - Attachment is obsolete: true
Are JsonLexer and JsonParser from yajjl? If so, do you want to keep them under the original MIT license? If yes, I think we should have some indication of the license in the header of the file or in the directory. If you're willing to rerelease the source under the MPL (and others haven't contributed patches under that license), then can you add the MPL to the top of the file?
Assignee: nobody → norrisboyd
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Looks great, thanks. I did tweak the formatting a bit and made some small changes to fix warnings I was seeing in Eclipse. I also added code to set the parent and proto of the wrapper object.

Checking in src/org/mozilla/javascript/NativeArray.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeArray.java,v  <--  NativeArray.java
new revision: 1.103; previous revision: 1.102
done
RCS file: /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJSON.java,v
done
Checking in src/org/mozilla/javascript/NativeJSON.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NativeJSON.java,v  <--  NativeJSON.java
initial revision: 1.1
done
Checking in src/org/mozilla/javascript/ScriptRuntime.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/ScriptRuntime.java,v  <--  ScriptRuntime.java
new revision: 1.314; previous revision: 1.313
done
RCS file: /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/json/JsonLexer.java,v
done
Checking in src/org/mozilla/javascript/json/JsonLexer.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/json/JsonLexer.java,v  <--  JsonLexer.java
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/json/JsonParser.java,v
done
Checking in src/org/mozilla/javascript/json/JsonParser.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/json/JsonParser.java,v  <--  JsonParser.java
initial revision: 1.1
done
Checking in testsrc/org/mozilla/javascript/tests/NativeArrayTest.java;
/cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/NativeArrayTest.java,v  <--  NativeArrayTest.java
new revision: 1.2; previous revision: 1.1
done
RCS file: /cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/json/JsonLexerTest.java,v
done
Checking in testsrc/org/mozilla/javascript/tests/json/JsonLexerTest.java;
/cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/json/JsonLexerTest.java,v  <--  JsonLexerTest.java
initial revision: 1.1
done
RCS file: /cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/json/JsonParserTest.java,v
done
Checking in testsrc/org/mozilla/javascript/tests/json/JsonParserTest.java;
/cvsroot/mozilla/js/rhino/testsrc/org/mozilla/javascript/tests/json/JsonParserTest.java,v  <--  JsonParserTest.java
initial revision: 1.1
done
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Depends on: 537483
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: