init
This commit is contained in:
21
node_modules/es5-ext/test/json/safe-stringify.js
generated
vendored
Normal file
21
node_modules/es5-ext/test/json/safe-stringify.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (t, a) {
|
||||
a(t({ foo: "bar" }), JSON.stringify({ foo: "bar" }));
|
||||
a(t({ foo: { elo: 12 } }), "{\"foo\":{\"elo\":12}}");
|
||||
a(
|
||||
t({ foo: { elo: 12, mel: { toJSON: function () { throw new Error("Nu nu!"); } } } }),
|
||||
"{\"foo\":{\"elo\":12}}"
|
||||
);
|
||||
a(
|
||||
t({ foo: { elo: 12 }, mel: { toJSON: function () { throw new Error("Nu nu!"); } } }),
|
||||
"{\"foo\":{\"elo\":12}}"
|
||||
);
|
||||
a(
|
||||
t({
|
||||
foo: { elo: 12 },
|
||||
mel: ["raz", { toJSON: function () { throw new Error("Nu nu!"); } }, 0, 2]
|
||||
}),
|
||||
"{\"foo\":{\"elo\":12},\"mel\":[\"raz\",0,2]}"
|
||||
);
|
||||
};
|
Reference in New Issue
Block a user