Skip to content

Commit 60d99cc

Browse files
committed
Version 1.5.2:
JSON2 library was updated to version of February 25, 2015.
1 parent de376fb commit 60d99cc

File tree

6 files changed

+73
-48
lines changed

6 files changed

+73
-48
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+
## April 5, 2015 - v1.5.2
5+
* JSON2 library was updated to version of February 25, 2015
6+
47
## January 13, 2015 - v1.5.1
58
* In ECMAScript 5 Polyfill added polyfill for the `String.prototype.split` method
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.1.0")]
17-
[assembly: AssemblyFileVersion("1.5.1.0")]
16+
[assembly: AssemblyVersion("1.5.2.0")]
17+
[assembly: AssemblyFileVersion("1.5.2.0")]
1818

1919
[module: DefaultCharSet(CharSet.Unicode)]

MsieJavaScriptEngine/Resources/json2.js

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
json2.js
3-
2014-02-04
3+
2015-02-25
44
55
Public Domain.
66
@@ -48,7 +48,9 @@
4848
Date.prototype.toJSON = function (key) {
4949
function f(n) {
5050
// Format integers to have at least two digits.
51-
return n < 10 ? '0' + n : n;
51+
return n < 10
52+
? '0' + n
53+
: n;
5254
}
5355
5456
return this.getUTCFullYear() + '-' +
@@ -146,10 +148,12 @@
146148
redistribute.
147149
*/
148150

149-
/*jslint evil: true, regexp: true */
151+
/*jslint
152+
eval, for, this
153+
*/
150154

151-
/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
152-
call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
155+
/*property
156+
JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
153157
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
154158
lastIndex, length, parse, prototype, push, replace, slice, stringify,
155159
test, toJSON, toString, valueOf
@@ -168,28 +172,32 @@ if (typeof JSON !== 'object') {
168172

169173
function f(n) {
170174
// Format integers to have at least two digits.
171-
return n < 10 ? '0' + n : n;
175+
return n < 10
176+
? '0' + n
177+
: n;
178+
}
179+
180+
function this_value() {
181+
return this.valueOf();
172182
}
173183

174184
if (typeof Date.prototype.toJSON !== 'function') {
175185

176186
Date.prototype.toJSON = function () {
177187

178188
return isFinite(this.valueOf())
179-
? this.getUTCFullYear() + '-' +
189+
? this.getUTCFullYear() + '-' +
180190
f(this.getUTCMonth() + 1) + '-' +
181-
f(this.getUTCDate()) + 'T' +
182-
f(this.getUTCHours()) + ':' +
183-
f(this.getUTCMinutes()) + ':' +
184-
f(this.getUTCSeconds()) + 'Z'
185-
: null;
191+
f(this.getUTCDate()) + 'T' +
192+
f(this.getUTCHours()) + ':' +
193+
f(this.getUTCMinutes()) + ':' +
194+
f(this.getUTCSeconds()) + 'Z'
195+
: null;
186196
};
187197

188-
String.prototype.toJSON =
189-
Number.prototype.toJSON =
190-
Boolean.prototype.toJSON = function () {
191-
return this.valueOf();
192-
};
198+
Boolean.prototype.toJSON = this_value;
199+
Number.prototype.toJSON = this_value;
200+
String.prototype.toJSON = this_value;
193201
}
194202

195203
var cx,
@@ -208,12 +216,14 @@ if (typeof JSON !== 'object') {
208216
// sequences.
209217

210218
escapable.lastIndex = 0;
211-
return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
219+
return escapable.test(string)
220+
? '"' + string.replace(escapable, function (a) {
212221
var c = meta[a];
213222
return typeof c === 'string'
214-
? c
215-
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
216-
}) + '"' : '"' + string + '"';
223+
? c
224+
: '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
225+
}) + '"'
226+
: '"' + string + '"';
217227
}
218228

219229

@@ -253,7 +263,9 @@ if (typeof JSON !== 'object') {
253263

254264
// JSON numbers must be finite. Encode non-finite numbers as null.
255265

256-
return isFinite(value) ? String(value) : 'null';
266+
return isFinite(value)
267+
? String(value)
268+
: 'null';
257269

258270
case 'boolean':
259271
case 'null':
@@ -297,10 +309,10 @@ if (typeof JSON !== 'object') {
297309
// brackets.
298310

299311
v = partial.length === 0
300-
? '[]'
301-
: gap
302-
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
303-
: '[' + partial.join(',') + ']';
312+
? '[]'
313+
: gap
314+
? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
315+
: '[' + partial.join(',') + ']';
304316
gap = mind;
305317
return v;
306318
}
@@ -314,7 +326,11 @@ if (typeof JSON !== 'object') {
314326
k = rep[i];
315327
v = str(k, value);
316328
if (v) {
317-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
329+
partial.push(quote(k) + (
330+
gap
331+
? ': '
332+
: ':'
333+
) + v);
318334
}
319335
}
320336
}
@@ -326,7 +342,11 @@ if (typeof JSON !== 'object') {
326342
if (Object.prototype.hasOwnProperty.call(value, k)) {
327343
v = str(k, value);
328344
if (v) {
329-
partial.push(quote(k) + (gap ? ': ' : ':') + v);
345+
partial.push(quote(k) + (
346+
gap
347+
? ': '
348+
: ':'
349+
) + v);
330350
}
331351
}
332352
}
@@ -336,10 +356,10 @@ if (typeof JSON !== 'object') {
336356
// and wrap them in braces.
337357

338358
v = partial.length === 0
339-
? '{}'
340-
: gap
341-
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
342-
: '{' + partial.join(',') + '}';
359+
? '{}'
360+
: gap
361+
? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
362+
: '{' + partial.join(',') + '}';
343363
gap = mind;
344364
return v;
345365
}
@@ -348,14 +368,14 @@ if (typeof JSON !== 'object') {
348368
// If the JSON object does not yet have a stringify method, give it one.
349369

350370
if (typeof JSON.stringify !== 'function') {
351-
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
371+
escapable = /[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
352372
meta = { // table of character substitutions
353373
'\b': '\\b',
354374
'\t': '\\t',
355375
'\n': '\\n',
356376
'\f': '\\f',
357377
'\r': '\\r',
358-
'"' : '\\"',
378+
'"': '\\"',
359379
'\\': '\\\\'
360380
};
361381
JSON.stringify = function (value, replacer, space) {
@@ -444,7 +464,7 @@ if (typeof JSON !== 'object') {
444464
if (cx.test(text)) {
445465
text = text.replace(cx, function (a) {
446466
return '\\u' +
447-
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
467+
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
448468
});
449469
}
450470

@@ -461,10 +481,13 @@ if (typeof JSON !== 'object') {
461481
// we look to see that the remaining characters are only whitespace or ']' or
462482
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
463483

464-
if (/^[\],:{}\s]*$/
465-
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
484+
if (
485+
/^[\],:{}\s]*$/.test(
486+
text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
466487
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
467-
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
488+
.replace(/(?:^|:|,)(?:\s*\[)+/g, '')
489+
)
490+
) {
468491

469492
// In the third stage we use the eval function to compile the text into a
470493
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
@@ -477,8 +500,8 @@ if (typeof JSON !== 'object') {
477500
// each name/value pair to a reviver function for possible transformation.
478501

479502
return typeof reviver === 'function'
480-
? walk({'': j}, '')
481-
: j;
503+
? walk({'': j}, '')
504+
: j;
482505
}
483506

484507
// 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.1</version>
5+
<version>1.5.2</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>In ECMAScript 5 Polyfill added polyfill for the `String.prototype.split` method.</releaseNotes>
15+
<releaseNotes>JSON2 library was updated to version of February 25, 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 & 3 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.1
4+
README file for MSIE JavaScript Engine for .NET 1.5.2
55

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

@@ -21,8 +21,7 @@
2121
=============
2222
RELEASE NOTES
2323
=============
24-
In ECMAScript 5 Polyfill added polyfill for
25-
the `String.prototype.split` method.
24+
JSON2 library was updated to version of February 25, 2015.
2625

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

0 commit comments

Comments
 (0)