Skip to content

decodeJson should use JSON.parse() when available#69

Open
cynthia wants to merge 1 commit intoglow:masterfrom
cynthia:master
Open

decodeJson should use JSON.parse() when available#69
cynthia wants to merge 1 commit intoglow:masterfrom
cynthia:master

Conversation

@cynthia
Copy link

@cynthia cynthia commented Feb 20, 2013

Currently, the decodeJSON() method in data.js does not use JSON.parse(), even when
available. This is possibly because at the point this library was written native parsing did
not exist, but now most modern browsers have support for it.

Using eval() triggers potentially leak-like behavior as it creates a new script context which
is kept around during the lifespan of the application. (for purposes of making it debuggable,
as one reason for this behavior) This change prevents this, which is crucial for memory
constrained platforms like TV/STB/BDPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant