]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / test / object / set-prototype-of / index.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js
new file mode 100644 (file)
index 0000000..aec2605
--- /dev/null
@@ -0,0 +1,23 @@
+'use strict';
+
+var create = require('../../../object/create')
+
+  , getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (t, a) {
+       var x = {}, y = {};
+
+       if (t === null) return;
+       a(t(x, y), x, "Return self object");
+       a(getPrototypeOf(x), y, "Object");
+       a.throws(function () { t(x); }, TypeError, "Undefined");
+       a.throws(function () { t('foo'); }, TypeError, "Primitive");
+       a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
+       x = create(null);
+       a.h1("Change null prototype");
+       a(t(x, y), x, "Result");
+       a(getPrototypeOf(x), y, "Prototype");
+       a.h1("Set null prototype");
+       a(t(y, null), y, "Result");
+       a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
+};