create.js 664 B

12345678910111213141516171819202122
  1. "use strict";
  2. var setPrototypeOf = require("../../object/set-prototype-of")
  3. , getPrototypeOf = Object.getPrototypeOf;
  4. module.exports = function (t, a) {
  5. var x = {}, obj;
  6. a(getPrototypeOf(t(x)), x, "Normal object");
  7. a(getPrototypeOf(t(null)), (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null");
  8. a.h1("Properties");
  9. a.h2("Normal object");
  10. a(getPrototypeOf((obj = t(x, { foo: { value: "bar" } }))), x, "Prototype");
  11. a(obj.foo, "bar", "Property");
  12. a.h2("Null");
  13. a(
  14. getPrototypeOf((obj = t(null, { foo: { value: "bar2" } }))),
  15. (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype"
  16. );
  17. a(obj.foo, "bar2", "Property");
  18. };