OLD | NEW |
---|---|
(Empty) | |
1 "use strict"; | |
tkent
2016/10/24 01:00:51
wpt/console/ is a new directory. We should skip i
| |
2 // https://heycam.github.io/webidl/#es-namespaces | |
3 // https://console.spec.whatwg.org/#console-namespace | |
4 | |
5 test(() => { | |
6 assert_true(self.hasOwnProperty("console")); | |
7 }, "console exists on the global object"); | |
8 | |
9 test(() => { | |
10 const propDesc = Object.getOwnPropertyDescriptor(self, "console"); | |
11 assert_equals(propDesc.writable, true, "must be writable"); | |
12 assert_equals(propDesc.enumerable, false, "must not be enumerable"); | |
13 assert_equals(propDesc.configurable, true, "must be configurable"); | |
14 assert_equals(propDesc.value, console, "must have the right value"); | |
15 }, "console has the right property descriptors"); | |
16 | |
17 test(() => { | |
18 assert_false("Console" in self); | |
19 }, "Console (uppercase, as if it were an interface) must not exist"); | |
20 | |
21 test(() => { | |
22 const prototype1 = Object.getPrototypeOf(console); | |
23 const prototype2 = Object.getPrototypeOf(prototype1); | |
24 | |
25 assert_equals(Object.getOwnPropertyNames(prototype1).length, 0, "The [[Prototy pe]] must have no properties"); | |
26 assert_equals(prototype2, Object.prototype, "The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"); | |
27 }, "The prototype chain must be correct"); | |
OLD | NEW |