Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 description("Test to ensure that global constructors have the right attributes") ; | |
| 2 | |
| 3 function descriptorShouldBe(object, property, expected) { | |
| 4 var test = 'Object.getOwnPropertyDescriptor('+object+", "+property+')'; | |
|
arv (Not doing code reviews)
2013/04/24 15:34:08
whitespace around binops
arv (Not doing code reviews)
2013/04/24 15:34:08
Stick to either " or '
| |
| 5 if ("writable" in expected) { | |
| 6 // shouldBe(test+'.writable', '' + expected.writable); | |
| 7 shouldBe(test+'.value', '' + expected.value); | |
| 8 shouldBeFalse(test+".hasOwnProperty('get')"); | |
| 9 shouldBeFalse(test+".hasOwnProperty('set')"); | |
| 10 } else { | |
| 11 shouldBe(test+'.get', '' + expected.get); | |
| 12 shouldBe(test+'.set', '' + expected.set); | |
| 13 shouldBeFalse(test+".hasOwnProperty('value')"); | |
| 14 shouldBeFalse(test+".hasOwnProperty('writable')"); | |
| 15 } | |
| 16 shouldBe(test+'.enumerable', '' + expected.enumerable); | |
| 17 shouldBe(test+'.configurable', '' + expected.configurable); | |
| 18 } | |
| 19 | |
| 20 var global = this; | |
| 21 | |
| 22 descriptorShouldBe("global", "'CSSRuleList'", {writable: true, enumerable: false , configurable: true, value:"CSSRuleList"}); | |
| 23 descriptorShouldBe("global", "'Document'", {writable: true, enumerable: false, c onfigurable: true, value:"Document"}); | |
| 24 descriptorShouldBe("global", "'Element'", {writable: true, enumerable: false, co nfigurable: true, value:"Element"}); | |
| 25 descriptorShouldBe("global", "'HTMLDivElement'", {writable: true, enumerable: fa lse, configurable: true, value:"HTMLDivElement"}); | |
| 26 descriptorShouldBe("global", "'ProgressEvent'", {writable: true, enumerable: fal se, configurable: true, value:"ProgressEvent"}); | |
| 27 descriptorShouldBe("global", "'Selection'", {writable: true, enumerable: false, configurable: true, value:"Selection"}); | |
| 28 descriptorShouldBe("global", "'XMLHttpRequest'", {writable: true, enumerable: fa lse, configurable: true, value:"XMLHttpRequest"}); | |
| OLD | NEW |