safe-stringify.js #1

  • //
  • guest/
  • jen_bottom/
  • ember/
  • tutorial/
  • testapp/
  • node_modules/
  • es5-ext/
  • test/
  • json/
  • safe-stringify.js
  • View
  • Commits
  • Open Download .zip Download (562 B)
"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]}");
};
# Change User Description Committed
#1 23539 jenbottom Adding the basic code for ember test appk, created with 'ember new' command