From 363723fc84f7b8477592e0105aeb331ec9a017af Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 14 Aug 2017 05:01:11 +0200 Subject: node_modules --- node_modules/es5-ext/test/json/safe-stringify.js | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 node_modules/es5-ext/test/json/safe-stringify.js (limited to 'node_modules/es5-ext/test/json/safe-stringify.js') diff --git a/node_modules/es5-ext/test/json/safe-stringify.js b/node_modules/es5-ext/test/json/safe-stringify.js new file mode 100644 index 000000000..2d13f3def --- /dev/null +++ b/node_modules/es5-ext/test/json/safe-stringify.js @@ -0,0 +1,26 @@ +"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]}"); +}; -- cgit v1.2.3