Skip to content

Commit

Permalink
JSON Build
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Oct 5, 2012
1 parent cfa4205 commit 922cedc
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 152 deletions.
88 changes: 45 additions & 43 deletions build/json-parse/json-parse-coverage.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions build/json-parse/json-parse-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ YUI.add('json-parse', function (Y, NAME) {
*
* <p>The <code>json</code> module is a rollup of <code>json-parse</code> and
* <code>json-stringify</code>.</p>
*
*
* <p>As their names suggest, <code>json-parse</code> adds support for parsing
* JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing
* JavaScript data into JSON strings (Y.JSON.stringify). You may choose to
Expand All @@ -39,7 +39,8 @@ YUI.add('json-parse', function (Y, NAME) {

// All internals kept private for security reasons
function fromGlobal(ref) {
return (Y.config.win || this || {})[ref];
var g = ((typeof global === 'object') ? global : undefined);
return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];
}


Expand Down Expand Up @@ -109,7 +110,7 @@ var _JSON = fromGlobal('JSON'),
* @private
*/
_UNSAFE = /[^\],:{}\s]/,

/**
* Replaces specific unicode characters with their appropriate \unnnn
* format. Some browsers ignore certain characters during eval.
Expand Down Expand Up @@ -175,7 +176,7 @@ var _JSON = fromGlobal('JSON'),
// incorrectly by some browser implementations.
// NOTE: This modifies the input if such characters are found!
s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);

// Test for any remaining invalid characters
if (!_UNSAFE.test(s.replace(_ESCAPES,'@').
replace(_VALUES,']').
Expand All @@ -188,7 +189,7 @@ var _JSON = fromGlobal('JSON'),

throw new SyntaxError('JSON.parse');
};

Y.namespace('JSON').parse = function (s,reviver) {
if (typeof s !== 'string') {
s += '';
Expand Down
2 changes: 1 addition & 1 deletion build/json-parse/json-parse-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions build/json-parse/json-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ YUI.add('json-parse', function (Y, NAME) {
*
* <p>The <code>json</code> module is a rollup of <code>json-parse</code> and
* <code>json-stringify</code>.</p>
*
*
* <p>As their names suggest, <code>json-parse</code> adds support for parsing
* JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing
* JavaScript data into JSON strings (Y.JSON.stringify). You may choose to
Expand All @@ -39,7 +39,8 @@ YUI.add('json-parse', function (Y, NAME) {

// All internals kept private for security reasons
function fromGlobal(ref) {
return (Y.config.win || this || {})[ref];
var g = ((typeof global === 'object') ? global : undefined);
return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];
}


Expand Down Expand Up @@ -109,7 +110,7 @@ var _JSON = fromGlobal('JSON'),
* @private
*/
_UNSAFE = /[^\],:{}\s]/,

/**
* Replaces specific unicode characters with their appropriate \unnnn
* format. Some browsers ignore certain characters during eval.
Expand Down Expand Up @@ -175,7 +176,7 @@ var _JSON = fromGlobal('JSON'),
// incorrectly by some browser implementations.
// NOTE: This modifies the input if such characters are found!
s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);

// Test for any remaining invalid characters
if (!_UNSAFE.test(s.replace(_ESCAPES,'@').
replace(_VALUES,']').
Expand All @@ -188,7 +189,7 @@ var _JSON = fromGlobal('JSON'),

throw new SyntaxError('JSON.parse');
};

Y.namespace('JSON').parse = function (s,reviver) {
if (typeof s !== 'string') {
s += '';
Expand Down
199 changes: 104 additions & 95 deletions build/json-stringify/json-stringify-coverage.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion build/json-stringify/json-stringify-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ YUI.add('json-stringify', function (Y, NAME) {
* @for JSON
* @static
*/
var _JSON = (Y.config.win || {}).JSON,
// All internals kept private for security reasons
function fromGlobal(ref) {
var g = ((typeof global === 'object') ? global : undefined);
return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];
}
var _JSON = fromGlobal('JSON'),
Lang = Y.Lang,
isFunction= Lang.isFunction,
isObject = Lang.isObject,
Expand Down
2 changes: 1 addition & 1 deletion build/json-stringify/json-stringify-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion build/json-stringify/json-stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ YUI.add('json-stringify', function (Y, NAME) {
* @for JSON
* @static
*/
var _JSON = (Y.config.win || {}).JSON,
// All internals kept private for security reasons
function fromGlobal(ref) {
var g = ((typeof global === 'object') ? global : undefined);
return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];
}
var _JSON = fromGlobal('JSON'),
Lang = Y.Lang,
isFunction= Lang.isFunction,
isObject = Lang.isObject,
Expand Down

0 comments on commit 922cedc

Please sign in to comment.