11 lines
431 B
JavaScript
11 lines
431 B
JavaScript
import * as namespace from "./namespace-set-prototype-of.js"
|
|
import { shouldBe, shouldThrow } from "./resources/assert.js";
|
|
|
|
shouldThrow(() => {
|
|
Object.setPrototypeOf(namespace, {});
|
|
}, `TypeError: Cannot set prototype of immutable prototype object`);
|
|
|
|
shouldBe(Reflect.setPrototypeOf(namespace, {}), false);
|
|
shouldBe(Reflect.setPrototypeOf(namespace, null), true);
|
|
shouldBe(Object.setPrototypeOf(namespace, null), namespace);
|