Skip to content

Commit bbd521c

Browse files
committed
JSON2 library was updated to version of May 10, 2023
1 parent 0e59be1 commit bbd521c

File tree

3 files changed

+3
-41
lines changed

3 files changed

+3
-41
lines changed

src/MsieJavaScriptEngine/MsieJavaScriptEngine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<IncludeSymbols>true</IncludeSymbols>
2626
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2727
<PackageTags>JavaScript;ECMAScript;MSIE;IE;Edge;Chakra</PackageTags>
28-
<PackageReleaseNotes>Fixed a error due to which the global object to become read-only after embedding of the host objects and types. Special thanks to Denis Pushkarev.</PackageReleaseNotes>
28+
<PackageReleaseNotes>JSON2 library was updated to version of May 10, 2023.</PackageReleaseNotes>
2929
<NeutralLanguage>en-US</NeutralLanguage>
3030
<PackageOutputPath>../../nuget</PackageOutputPath>
3131
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>

src/MsieJavaScriptEngine/Resources/json2.js

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// json2.js
2-
// 2022-10-30
2+
// 2023-05-10
33
// Public Domain.
44
// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
55

@@ -231,29 +231,6 @@ if (typeof JSON !== "object") {
231231
}
232232

233233

234-
// This variable is initialized with an empty array every time
235-
// JSON.stringify() is invoked and checked by the str() function. It's
236-
// used to keep references to object structures and capture cyclic
237-
// objects. Every new object is checked for its existence in this
238-
// array. If it's found it means the JSON object is cyclic and we have
239-
// to stop execution and throw a TypeError accordingly the ECMA262
240-
// (see NOTE 1 by the link https://tc39.es/ecma262/#sec-json.stringify).
241-
242-
var seen;
243-
244-
// Emulate [].includes(). It's actual for old-fashioned JScript.
245-
246-
function includes(array, value) {
247-
var i;
248-
for (i = 0; i < array.length; i += 1) {
249-
if (value === array[i]) {
250-
return true;
251-
}
252-
}
253-
return false;
254-
}
255-
256-
257234
function str(key, holder) {
258235

259236
// Produce a string from holder[key].
@@ -318,16 +295,6 @@ if (typeof JSON !== "object") {
318295
return "null";
319296
}
320297

321-
// Check the value is not circular object. Otherwise throw TypeError.
322-
323-
if (includes(seen, value)) {
324-
throw new TypeError("Converting circular structure to JSON");
325-
}
326-
327-
// Keep the value for the further check on circular references.
328-
329-
seen.push(value);
330-
331298
// Make an array to hold the partial results of stringifying this object value.
332299

333300
gap += indent;
@@ -461,10 +428,6 @@ if (typeof JSON !== "object") {
461428
throw new Error("JSON.stringify");
462429
}
463430

464-
// Initialize the reference keeper.
465-
466-
seen = [];
467-
468431
// Make a fake root object containing our value under the key of "".
469432
// Return the result of stringifying the value.
470433

src/MsieJavaScriptEngine/readme.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
=============
2222
RELEASE NOTES
2323
=============
24-
Fixed a error due to which the global object to become read-only after embedding
25-
of the host objects and types. Special thanks to Denis Pushkarev.
24+
JSON2 library was updated to version of May 10, 2023.
2625

2726
============
2827
PROJECT SITE

0 commit comments

Comments
 (0)