Skip to content

Commit 8c68e58

Browse files
committed
Version 1.5.3:
JSON2 library was updated to version of May 3, 2015.
1 parent 60d99cc commit 8c68e58

File tree

6 files changed

+69
-59
lines changed

6 files changed

+69
-59
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Change log
22
==========
33

4+
## May 5, 2015 - v1.5.3
5+
* JSON2 library was updated to version of May 3, 2015
6+
47
## April 5, 2015 - v1.5.2
58
* JSON2 library was updated to version of February 25, 2015
69

MsieJavaScriptEngine/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[assembly: ComVisible(false)]
1414
[assembly: Guid("ae6911c9-e2a9-4386-ab90-3722a9166564")]
1515

16-
[assembly: AssemblyVersion("1.5.2.0")]
17-
[assembly: AssemblyFileVersion("1.5.2.0")]
16+
[assembly: AssemblyVersion("1.5.3.0")]
17+
[assembly: AssemblyFileVersion("1.5.3.0")]
1818

1919
[module: DefaultCharSet(CharSet.Unicode)]

MsieJavaScriptEngine/Resources/json2.js

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
json2.js
3-
2015-02-25
3+
2015-05-03
44
55
Public Domain.
66
@@ -17,7 +17,9 @@
1717
1818
1919
This file creates a global JSON object containing two methods: stringify
20-
and parse.
20+
and parse. This file is provides the ES5 JSON capability to ES3 systems.
21+
If a project might run on IE8 or earlier, then this file should be included.
22+
This file does nothing on ES5 systems.
2123
2224
JSON.stringify(value, replacer, space)
2325
value any JavaScript value, usually an object or array.
@@ -49,8 +51,8 @@
4951
function f(n) {
5052
// Format integers to have at least two digits.
5153
return n < 10
52-
? '0' + n
53-
: n;
54+
? '0' + n
55+
: n;
5456
}
5557
5658
return this.getUTCFullYear() + '-' +
@@ -96,8 +98,9 @@
9698
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
9799
98100
text = JSON.stringify([new Date()], function (key, value) {
99-
return this[key] instanceof Date ?
100-
'Date(' + this[key] + ')' : value;
101+
return this[key] instanceof Date
102+
? 'Date(' + this[key] + ')'
103+
: value;
101104
});
102105
// text is '["Date(---current time---)"]'
103106
@@ -169,12 +172,19 @@ if (typeof JSON !== 'object') {
169172

170173
(function () {
171174
'use strict';
175+
176+
var rx_one = /^[\],:{}\s]*$/,
177+
rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
178+
rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
179+
rx_four = /(?:^|:|,)(?:\s*\[)+/g,
180+
rx_escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
181+
rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
172182

173183
function f(n) {
174184
// Format integers to have at least two digits.
175185
return n < 10
176-
? '0' + n
177-
: n;
186+
? '0' + n
187+
: n;
178188
}
179189

180190
function this_value() {
@@ -186,23 +196,21 @@ if (typeof JSON !== 'object') {
186196
Date.prototype.toJSON = function () {
187197

188198
return isFinite(this.valueOf())
189-
? this.getUTCFullYear() + '-' +
190-
f(this.getUTCMonth() + 1) + '-' +
191-
f(this.getUTCDate()) + 'T' +
192-
f(this.getUTCHours()) + ':' +
193-
f(this.getUTCMinutes()) + ':' +
194-
f(this.getUTCSeconds()) + 'Z'
195-
: null;
199+
? this.getUTCFullYear() + '-' +
200+
f(this.getUTCMonth() + 1) + '-' +
201+
f(this.getUTCDate()) + 'T' +
202+
f(this.getUTCHours()) + ':' +
203+
f(this.getUTCMinutes()) + ':' +
204+
f(this.getUTCSeconds()) + 'Z'
205+
: null;
196206
};
197207

198208
Boolean.prototype.toJSON = this_value;
199209
Number.prototype.toJSON = this_value;
200210
String.prototype.toJSON = this_value;
201211
}
202212

203-
var cx,
204-
escapable,
205-
gap,
213+
var gap,
206214
indent,
207215
meta,
208216
rep;
@@ -215,15 +223,15 @@ if (typeof JSON !== 'object') {
215223
// Otherwise we must also replace the offending characters with safe escape
216224
// sequences.
217225

218-
escapable.lastIndex = 0;
219-
return escapable.test(string)
220-
? '"' + string.replace(escapable, function (a) {
221-
var c = meta[a];
222-
return typeof c === 'string'
223-
? c
224-
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
225-
}) + '"'
226-
: '"' + string + '"';
226+
rx_escapable.lastIndex = 0;
227+
return rx_escapable.test(string)
228+
? '"' + string.replace(rx_escapable, function (a) {
229+
var c = meta[a];
230+
return typeof c === 'string'
231+
? c
232+
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
233+
}) + '"'
234+
: '"' + string + '"';
227235
}
228236

229237

@@ -264,8 +272,8 @@ if (typeof JSON !== 'object') {
264272
// JSON numbers must be finite. Encode non-finite numbers as null.
265273

266274
return isFinite(value)
267-
? String(value)
268-
: 'null';
275+
? String(value)
276+
: 'null';
269277

270278
case 'boolean':
271279
case 'null':
@@ -309,10 +317,10 @@ if (typeof JSON !== 'object') {
309317
// brackets.
310318

311319
v = partial.length === 0
312-
? '[]'
313-
: gap
314-
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
315-
: '[' + partial.join(',') + ']';
320+
? '[]'
321+
: gap
322+
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
323+
: '[' + partial.join(',') + ']';
316324
gap = mind;
317325
return v;
318326
}
@@ -328,8 +336,8 @@ if (typeof JSON !== 'object') {
328336
if (v) {
329337
partial.push(quote(k) + (
330338
gap
331-
? ': '
332-
: ':'
339+
? ': '
340+
: ':'
333341
) + v);
334342
}
335343
}
@@ -344,8 +352,8 @@ if (typeof JSON !== 'object') {
344352
if (v) {
345353
partial.push(quote(k) + (
346354
gap
347-
? ': '
348-
: ':'
355+
? ': '
356+
: ':'
349357
) + v);
350358
}
351359
}
@@ -356,10 +364,10 @@ if (typeof JSON !== 'object') {
356364
// and wrap them in braces.
357365

358366
v = partial.length === 0
359-
? '{}'
360-
: gap
361-
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
362-
: '{' + partial.join(',') + '}';
367+
? '{}'
368+
: gap
369+
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
370+
: '{' + partial.join(',') + '}';
363371
gap = mind;
364372
return v;
365373
}
@@ -368,7 +376,6 @@ if (typeof JSON !== 'object') {
368376
// If the JSON object does not yet have a stringify method, give it one.
369377

370378
if (typeof JSON.stringify !== 'function') {
371-
escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
372379
meta = { // table of character substitutions
373380
'\b': '\\b',
374381
'\t': '\\t',
@@ -425,7 +432,6 @@ if (typeof JSON !== 'object') {
425432
// If the JSON object does not yet have a parse method, give it one.
426433

427434
if (typeof JSON.parse !== 'function') {
428-
cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
429435
JSON.parse = function (text, reviver) {
430436

431437
// The parse method takes a text and an optional reviver function, and returns
@@ -460,9 +466,9 @@ if (typeof JSON !== 'object') {
460466
// incorrectly, either silently deleting them, or treating them as line endings.
461467

462468
text = String(text);
463-
cx.lastIndex = 0;
464-
if (cx.test(text)) {
465-
text = text.replace(cx, function (a) {
469+
rx_dangerous.lastIndex = 0;
470+
if (rx_dangerous.test(text)) {
471+
text = text.replace(rx_dangerous, function (a) {
466472
return '\\u' +
467473
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
468474
});
@@ -482,10 +488,11 @@ if (typeof JSON !== 'object') {
482488
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
483489

484490
if (
485-
/^[\],:{}\s]*$/.test(
486-
text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
487-
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
488-
.replace(/(?:^|:|,)(?:\s*\[)+/g, '')
491+
rx_one.test(
492+
text
493+
.replace(rx_two, '@')
494+
.replace(rx_three, ']')
495+
.replace(rx_four, '')
489496
)
490497
) {
491498

@@ -500,8 +507,8 @@ if (typeof JSON !== 'object') {
500507
// each name/value pair to a reviver function for possible transformation.
501508

502509
return typeof reviver === 'function'
503-
? walk({'': j}, '')
504-
: j;
510+
? walk({'': j}, '')
511+
: j;
505512
}
506513

507514
// If the text is not JSON parseable, then a SyntaxError is thrown.

MsieJavaScriptEngine/Resources/json2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

NuGet/MsieJavaScriptEngine.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>MsieJavaScriptEngine</id>
5-
<version>1.5.2</version>
5+
<version>1.5.3</version>
66
<title>MSIE JavaScript Engine for .NET</title>
77
<authors>Andrey Taritsyn</authors>
88
<owners>Andrey Taritsyn</owners>
@@ -12,7 +12,7 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>This project is a .NET wrapper for working with the Internet Explorer's JavaScript engines (JsRT version of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (http://github.com/paulcbetts/SassAndCoffee) and Chakra Sample Hosts (http://github.com/panopticoncentral/chakra-host).</description>
1414
<summary>This project is a .NET wrapper for working with the Internet Explorer's JavaScript engines (JsRT version of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine).</summary>
15-
<releaseNotes>JSON2 library was updated to version of February 25, 2015.</releaseNotes>
15+
<releaseNotes>JSON2 library was updated to version of May 3, 2015.</releaseNotes>
1616
<copyright>Copyright (c) 2012-2015 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1717
<language>en-US</language>
1818
<tags>JavaScript ECMAScript MSIE IE Chakra</tags>

NuGet/readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
----------------------------------------------------------------------
4-
README file for MSIE JavaScript Engine for .NET 1.5.2
4+
README file for MSIE JavaScript Engine for .NET 1.5.3
55

66
----------------------------------------------------------------------
77

@@ -21,7 +21,7 @@
2121
=============
2222
RELEASE NOTES
2323
=============
24-
JSON2 library was updated to version of February 25, 2015.
24+
JSON2 library was updated to version of May 3, 2015.
2525

2626
============
2727
PROJECT SITE

0 commit comments

Comments
 (0)