mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-10-25 18:01:23 +02:00
These modules are adapted from the JSON5 project. JSON5 was adopted by
the Dojo Toolkit for use by dojo/parser to facilitate parsing data attributes without using the unsafe
JavaScript function eval(). As such only the parsing related modules from JSON5 are included.
Updates from the JSON5 project can be incorporated into the Dojo Toolkit with the following process:
- Clone the JSON5 repository
- Convert the relevant files to ES5 syntax with TypeScript's compiler:
tsc lib/parse.js lib/unicode.js lib/util.js --allowJs --module ES6 --outDir dojo --removeComments --target ES5
- Visually compare the existing modules in
dojo/json5with the newly converted modules to see what changes will need to be made - Copy the files from the
json5/dojofolder to thedojo/json5folder - Manual updates:
- IMPORTANT: wrap the
lexStatesobject propertydefault:in quotes =>'default': - convert indentation to tabs in each module
- remove any trailing commas
- convert each module to AMD syntax
- IMPORTANT: wrap the
- Update
json5/parse.jsto usedojo/stringmethods for ES5 String methods:- require
'../string'asdstring - replace calls to
codePointAtwithdstring.codePointAt(str, position) - replace calls to
String.fromCodePointwithdstring.fromCodePoint
- require
- Run Dojo's JSON5 tests to ensure the updates were successful:
dojo/node_modules/intern-geezer/client.html?config=tests/dojo.intern&suites=tests/unit/json5
- Update the line below recording the most recent update
Current as of 2020-06-12, commit 32bb2cd