User:Rektide/JEP-WebStorage: Difference between revisions

Jump to navigation Jump to search
no edit summary
(initial commit)
 
No edit summary
Line 63: Line 63:
The implementation of getObject and setObject rely upon [http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft EcmaScript 3.1 compliant implementations] of two functions (described in 12.15 of the EcmaScript 3.1 final draft):
The implementation of getObject and setObject rely upon [http://wiki.ecmascript.org/doku.php?id=es3.1:es3.1_proposal_working_draft EcmaScript 3.1 compliant implementations] of two functions (described in 12.15 of the EcmaScript 3.1 final draft):


# <code>JSON.parse( text )<code> to convert a stored <code>DOMString</code> into an <code>Object</code>.
# <code>JSON.parse( text )</code> to convert a stored <code>DOMString</code> into an <code>Object</code>.
# <code>JSON.stringify( value )</code> to convert an <code>Object</code> into a storeable <code>DOMString</code>.
# <code>JSON.stringify( value )</code> to convert an <code>Object</code> into a storeable <code>DOMString</code>.


Line 75: Line 75:
In keeping with the behavior of JSON.parse, <code>getObject</code> throws a <code>SyntaxError</code> if it encounters any item which can not be parsed to a JavaScript <code>Object</code>.
In keeping with the behavior of JSON.parse, <code>getObject</code> throws a <code>SyntaxError</code> if it encounters any item which can not be parsed to a JavaScript <code>Object</code>.


Objects returned by getObject()
Objects returned by <code>getObject</code> are not assumed to have equivalence to an object used to <code>setObject</code>


===== setObject =====
===== setObject =====
6

edits

Navigation menu