Bump Dojo from 1.16.5 to 1.17.3.

This should help with some of the security findings.
This commit is contained in:
supahgreg
2025-10-05 04:33:59 +00:00
parent 6e8a188e4a
commit 46ebef7ebf
25 changed files with 149 additions and 388 deletions

23
lib/dojo/json5/LICENSE.md Normal file
View File

@@ -0,0 +1,23 @@
MIT License
Copyright (c) 2012-2018 Aseem Kishore, and [others].
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
[others]: https://github.com/json5/json5/contributors

28
lib/dojo/json5/README.md Normal file
View File

@@ -0,0 +1,28 @@
These modules are adapted from the [JSON5](https://github.com/json5/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](https://github.com/json5/json5.git)
* Convert the relevant files to ES5 syntax with TypeScript's compiler:
```bash
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/json5` with the newly converted modules to see what changes will need
to be made
* Copy the files from the `json5/dojo` folder to the `dojo/json5` folder
* Manual updates:
* IMPORTANT: wrap the `lexStates` object property `default:` in quotes => `'default':`
* convert indentation to tabs in each module
* remove any trailing commas
* convert each module to AMD syntax
* Update `json5/parse.js` to use `dojo/string` methods for ES5 String methods:
* require `'../string'` as `dstring`
* replace calls to `codePointAt` with `dstring.codePointAt(str, position)`
* replace calls to `String.fromCodePoint` with `dstring.fromCodePoint`
* 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](https://github.com/json5/json5/commit/32bb2cdae4864b2ac80a6d9b4045efc4cc54f47a)

8
lib/dojo/json5/parse.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
lib/dojo/json5/util.js Normal file
View File

@@ -0,0 +1,8 @@
/*
Copyright (c) 2004-2016, The JS Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
//>>built
define("dojo/json5/util",["./unicode"],function(_1){return {isSpaceSeparator:function(c){return typeof c==="string"&&_1.Space_Separator.test(c);},isIdStartChar:function(c){return typeof c==="string"&&((c>="a"&&c<="z")||(c>="A"&&c<="Z")||(c==="$")||(c==="_")||_1.ID_Start.test(c));},isIdContinueChar:function(c){return typeof c==="string"&&((c>="a"&&c<="z")||(c>="A"&&c<="Z")||(c>="0"&&c<="9")||(c==="$")||(c==="_")||(c==="")||(c==="")||_1.ID_Continue.test(c));},isDigit:function(c){return typeof c==="string"&&/[0-9]/.test(c);},isHexDigit:function(c){return typeof c==="string"&&/[0-9A-Fa-f]/.test(c);},};});