Commit dfe18a56 authored by barraclough@apple.com's avatar barraclough@apple.com

Most built-in properties are not deletable

https://bugs.webkit.org/show_bug.cgi?id=61014

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

Our static hash tables don't allow for deleting properties.
This is the cause of a bunch of expected failures in LayoutTests/sputnik.

This fixes the problem by reifying all static functions immediately prior
to the first deletion.  Reification is tracked by a flag on the structure,
so properties will no longer 'bounce-back' on later access.

Theoretically there could probably also be an issue with custom accessor
properties, but we probably do not really require any of these to be
Configurable anyway. I'll follow up with a separate patch to address this.

* runtime/ClassInfo.h:
(JSC::ClassInfo::hasStaticProperties):
    - detects static property tables.
* runtime/JSObject.cpp:
(JSC::JSObject::deleteProperty):
    - call reifyStaticFunctions before deletion.
(JSC::JSObject::reifyStaticFunctions):
    - If the class has static functions, set them up now.
* runtime/JSObject.h:
(JSC::JSObject::staticFunctionsReified):
    - returns true if static functions have been reified,
      and as such should no longer be added.
* runtime/Lookup.cpp:
(JSC::setUpStaticFunctionSlot):
    - If static functions have been reified do not add.
* runtime/Lookup.h:
(JSC::HashTable::ConstIterator::ConstIterator):
(JSC::HashTable::ConstIterator::operator->):
(JSC::HashTable::ConstIterator::operator*):
(JSC::HashTable::ConstIterator::operator!=):
(JSC::HashTable::ConstIterator::operator++):
(JSC::HashTable::ConstIterator::skipInvalidKeys):
(JSC::HashTable::begin):
(JSC::HashTable::end):
(JSC::getStaticPropertySlot):
(JSC::getStaticPropertyDescriptor):
(JSC::getStaticFunctionSlot):
(JSC::getStaticFunctionDescriptor):
    - setUpStaticFunctionSlot may not add, returns a bool.
(JSC::lookupPut):
    - remove redundant branch.
* runtime/Structure.cpp:
(JSC::Structure::Structure):
    - initialize new flag in constructors.
* runtime/Structure.h:
(JSC::Structure::staticFunctionsReified):
(JSC::Structure::setStaticFunctionsReified):
    - added flag

LayoutTests: 

Mostly checking in passing results, added a couple of extra test cases to fast/js/delete-syntax.

* fast/js/delete-syntax-expected.txt:
* fast/js/script-tests/delete-syntax.js:
* ietestcenter/Javascript/11.4.1-4.a-10-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/S15.4.4_A1.1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4.1_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4_A3-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.10_Date.prototype.getFullYear/S15.9.5.10_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.11_Date.prototype.getUTCFullYear/S15.9.5.11_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.12_Date.prototype.getMonth/S15.9.5.12_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.13_Date.prototype.getUTCMonth/S15.9.5.13_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.14_Date.prototype.getDate/S15.9.5.14_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.15_Date.prototype.getUTCDate/S15.9.5.15_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.16_Date.prototype.getDay/S15.9.5.16_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.17_Date.prototype.getUTCDay/S15.9.5.17_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.18_Date.prototype.getHours/S15.9.5.18_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.19_Date.prototype.getUTCHours/S15.9.5.19_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.20_Date.prototype.getMinutes/S15.9.5.20_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.21_Date.prototype.getUTCMinutes/S15.9.5.21_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.22_Date.prototype.getSeconds/S15.9.5.22_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.23_Date.prototype.getUTCSeconds/S15.9.5.23_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.24_Date.prototype.getMilliseconds/S15.9.5.24_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.25_Date.prototype.getUTCMilliseconds/S15.9.5.25_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.26_Date.prototype.getTimezoneOffset/S15.9.5.26_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.27_Date.prototype.setTime/S15.9.5.27_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.28_Date.prototype.setMilliseconds/S15.9.5.28_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.29_Date.prototype.setUTCMilliseconds/S15.9.5.29_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.2_Date.prototype.toString/S15.9.5.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.30_Date.prototype.setSeconds/S15.9.5.30_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.31_Date.prototype.setUTCSeconds/S15.9.5.31_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.32_Date.prototype.setMinutes/S15.9.5.32_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.33_Date.prototype.setUTCMinutes/S15.9.5.33_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.34_Date.prototype.setHours/S15.9.5.34_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.35_Date.prototype.setUTCHours/S15.9.5.35_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.36_Date.prototype.setDate/S15.9.5.36_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.37_Date.prototype.setUTCDate/S15.9.5.37_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.38_Date.prototype.setMonth/S15.9.5.38_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.39_Date.prototype.setUTCMonth/S15.9.5.39_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.3_Date.prototype.toDateString/S15.9.5.3_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.40_Date.prototype.setFullYear/S15.9.5.40_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.41_Date.prototype.setUTCFullYear/S15.9.5.41_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.42_Date.prototype.toUTCString/S15.9.5.42_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.4_Date.prototype.toTimeString/S15.9.5.4_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.5_Date.prototype.toLocaleString/S15.9.5.5_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.6_Date.prototype.toLocaleDateString/S15.9.5.6_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.7_Date.prototype.toLocaleTimeString/S15.9.5.7_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.8_Date.prototype.valueOf/S15.9.5.8_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.9_Date.prototype.getTime/S15.9.5.9_A1_T2-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 91b21bd6
2011-10-14 Gavin Barraclough <baraclough@apple.com>
Most built-in properties are not deletable
https://bugs.webkit.org/show_bug.cgi?id=61014
Reviewed by Filip Pizlo.
Mostly checking in passing results, added a couple of extra test cases to fast/js/delete-syntax.
* fast/js/delete-syntax-expected.txt:
* fast/js/script-tests/delete-syntax.js:
* ietestcenter/Javascript/11.4.1-4.a-10-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/S15.4.4_A1.1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4.1_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/S15.5.4_A3-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.2/S15.6.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.3/15.6.3.1_Boolean.prototype/S15.6.3.1_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.6_Boolean/15.6.4/S15.6.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.2/S15.7.2.1_A4-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.3/15.7.3.1_Number.prototype/S15.7.3.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.7_Number/15.7.4/S15.7.4_A1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.2_Date.parse/S15.9.4.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.4/15.9.4.3_Date.UTC/S15.9.4.3_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.10_Date.prototype.getFullYear/S15.9.5.10_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.11_Date.prototype.getUTCFullYear/S15.9.5.11_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.12_Date.prototype.getMonth/S15.9.5.12_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.13_Date.prototype.getUTCMonth/S15.9.5.13_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.14_Date.prototype.getDate/S15.9.5.14_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.15_Date.prototype.getUTCDate/S15.9.5.15_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.16_Date.prototype.getDay/S15.9.5.16_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.17_Date.prototype.getUTCDay/S15.9.5.17_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.18_Date.prototype.getHours/S15.9.5.18_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.19_Date.prototype.getUTCHours/S15.9.5.19_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.20_Date.prototype.getMinutes/S15.9.5.20_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.21_Date.prototype.getUTCMinutes/S15.9.5.21_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.22_Date.prototype.getSeconds/S15.9.5.22_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.23_Date.prototype.getUTCSeconds/S15.9.5.23_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.24_Date.prototype.getMilliseconds/S15.9.5.24_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.25_Date.prototype.getUTCMilliseconds/S15.9.5.25_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.26_Date.prototype.getTimezoneOffset/S15.9.5.26_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.27_Date.prototype.setTime/S15.9.5.27_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.28_Date.prototype.setMilliseconds/S15.9.5.28_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.29_Date.prototype.setUTCMilliseconds/S15.9.5.29_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.2_Date.prototype.toString/S15.9.5.2_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.30_Date.prototype.setSeconds/S15.9.5.30_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.31_Date.prototype.setUTCSeconds/S15.9.5.31_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.32_Date.prototype.setMinutes/S15.9.5.32_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.33_Date.prototype.setUTCMinutes/S15.9.5.33_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.34_Date.prototype.setHours/S15.9.5.34_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.35_Date.prototype.setUTCHours/S15.9.5.35_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.36_Date.prototype.setDate/S15.9.5.36_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.37_Date.prototype.setUTCDate/S15.9.5.37_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.38_Date.prototype.setMonth/S15.9.5.38_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.39_Date.prototype.setUTCMonth/S15.9.5.39_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.3_Date.prototype.toDateString/S15.9.5.3_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.40_Date.prototype.setFullYear/S15.9.5.40_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.41_Date.prototype.setUTCFullYear/S15.9.5.41_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.42_Date.prototype.toUTCString/S15.9.5.42_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.4_Date.prototype.toTimeString/S15.9.5.4_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.5_Date.prototype.toLocaleString/S15.9.5.5_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.6_Date.prototype.toLocaleDateString/S15.9.5.6_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.7_Date.prototype.toLocaleTimeString/S15.9.5.7_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.8_Date.prototype.valueOf/S15.9.5.8_A1_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.9_Date/15.9.5/15.9.5.9_Date.prototype.getTime/S15.9.5.9_A1_T2-expected.txt:
2011-10-14 Ryosuke Niwa <rniwa@webkit.org>
Windows rebaseline after r97522.
......@@ -23,6 +23,12 @@ PASS delete (window.nonexistent) is true
PASS delete (window["nonexistent"]) is true
PASS delete "x" is true
PASS delete (2 + 3) is true
PASS Math.cos is mathCos
PASS Math.sin is undefined
PASS Math.tan is null
PASS RegExp.prototype.compile is regExpPrototypeCompile
PASS RegExp.prototype.exec is undefined
PASS RegExp.prototype.test is null
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -51,5 +51,22 @@ shouldBeTrue('delete (window["nonexistent"])');
shouldBeTrue('delete "x"');
shouldBeTrue('delete (2 + 3)');
var mathCos = Math.cos;
delete Math.sin;
Math.tan = null;
// Try deleting & overwriting static properties.
shouldBe("Math.cos", "mathCos");
shouldBe("Math.sin", "undefined");
shouldBe("Math.tan", "null");
var regExpPrototypeCompile = RegExp.prototype.compile;
RegExp.prototype.test = null;
Object.preventExtensions(RegExp.prototype);
delete RegExp.prototype.exec;
// Reverse order of delete & overwrite, tests delete after preventExtensions.
shouldBe("RegExp.prototype.compile", "regExpPrototypeCompile");
shouldBe("RegExp.prototype.exec", "undefined");
shouldBe("RegExp.prototype.test", "null");
var successfullyParsed = true;
......@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS ES5Harness.preconditionPassed is true
FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined).
PASS ES5Harness.testPassed is true
PASS successfullyParsed is true
TEST COMPLETE
......
S15.4.4_A1.1_T2
FAIL SputnikError: #1: delete Array.prototype.toString; var Array.prototype = Object(); Array.prototype.toString() === "[object " + "Array" + "]". Actual:
PASS
TEST COMPLETE
S15.5.4.1_A1_T2
FAIL SputnikError: #3: __constr = String.prototype.constructor; __instance = new __constr("choosing one"); delete String.prototype.toString; __instance.toString() === __to_string_result. Actual: __instance.toString() ===choosing one __to_string_result ===[object String]
PASS [object String]
TEST COMPLETE
S15.5.4_A1
FAIL SputnikError: #1: delete String.prototype.toString; String.prototype.toString() === "[object "+"String"+"]". Actual: String.prototype.toString() ===
PASS [object String]
TEST COMPLETE
S15.5.4_A3
FAIL SputnikError: #2: delete String.prototype.toString; String.prototype.toString() == "[object "+"String"+"]". Actual: String.prototype.toString() ==
PASS [object String]
TEST COMPLETE
S15.6.2.1_A4
FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Boolean"
PASS
TEST COMPLETE
S15.6.3.1_A1
FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean"
PASS
TEST COMPLETE
S15.6.4_A1
FAIL SputnikError: #3: The [[Class]] property of the Boolean prototype object is set to "Boolean"
PASS
TEST COMPLETE
S15.7.2.1_A4
FAIL SputnikError: #1: The [[Class]] property of the newly constructed object is set to "Number"
PASS
TEST COMPLETE
S15.7.3.1_A2_T1
FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number"
PASS
TEST COMPLETE
S15.7.4_A1
FAIL SputnikError: #3: The [[Class]] property of the Number prototype object is set to "Number"
PASS
TEST COMPLETE
S15.9.4.2_A1_T2
FAIL SputnikError: #2: The Date.parse property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.4.3_A1_T2
FAIL SputnikError: #2: The Date.UTC property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.10_A1_T2
FAIL SputnikError: #2: The Date.prototype.getFullYear property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.11_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCFullYear property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.12_A1_T2
FAIL SputnikError: #2: The Date.prototype.getMonth property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.13_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCMonth property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.14_A1_T2
FAIL SputnikError: #2: The Date.prototype.getDate property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.15_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCDate property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.16_A1_T2
FAIL SputnikError: #2: The Date.prototype.getDay property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.17_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCDay property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.18_A1_T2
FAIL SputnikError: #2: The Date.prototype.getHours property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.19_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCHours property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.20_A1_T2
FAIL SputnikError: #2: The Date.prototype.getMinutes property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.21_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCMinutes property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.22_A1_T2
FAIL SputnikError: #2: The Date.prototype.getSeconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.23_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCSeconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.24_A1_T2
FAIL SputnikError: #2: The Date.prototype.getMilliseconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.25_A1_T2
FAIL SputnikError: #2: The Date.prototype.getUTCMilliseconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.26_A1_T2
FAIL SputnikError: #2: The Date.prototype.getTimezoneOffset property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.27_A1_T2
FAIL SputnikError: #2: The Date.prototype.setTime property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.28_A1_T2
FAIL SputnikError: #2: The Date.prototype.setMilliseconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.29_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCMilliseconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.2_A1_T2
FAIL SputnikError: #2: The Date.prototype.toString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.30_A1_T2
FAIL SputnikError: #2: The Date.prototype.setSeconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.31_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCSeconds property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.32_A1_T2
FAIL SputnikError: #2: The Date.prototype.setMinutes property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.33_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCMinutes property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.34_A1_T2
FAIL SputnikError: #2: The Date.prototype.setHours property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.35_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCHours property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.36_A1_T2
FAIL SputnikError: #2: The Date.prototype.setDate property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.37_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCDate property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.38_A1_T2
FAIL SputnikError: #2: The Date.prototype.setMonth property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.39_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCMonth property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.3_A1_T2
FAIL SputnikError: #2: The Date.prototype.toDateString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.40_A1_T2
FAIL SputnikError: #2: The Date.prototype.setFullYear property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.41_A1_T2
FAIL SputnikError: #2: The Date.prototype.setUTCFullYear property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.42_A1_T2
FAIL SputnikError: #2: The Date.prototype.toUTCString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.4_A1_T2
FAIL SputnikError: #2: The Date.prototype.toTimeString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.5_A1_T2
FAIL SputnikError: #2: The Date.prototype.toLocaleString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.6_A1_T2
FAIL SputnikError: #2: The Date.prototype.toLocaleDateString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.7_A1_T2
FAIL SputnikError: #2: The Date.prototype.toLocaleTimeString property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.8_A1_T2
FAIL SputnikError: #2: The Date.prototype.valueOf property has not the attributes DontDelete
PASS
TEST COMPLETE
S15.9.5.9_A1_T2
FAIL SputnikError: #2: The Date.prototype.getTime property has not the attributes DontDelete
PASS
TEST COMPLETE
2011-10-14 Gavin Barraclough <baraclough@apple.com>
Most built-in properties are not deletable
https://bugs.webkit.org/show_bug.cgi?id=61014
Reviewed by Filip Pizlo.
Our static hash tables don't allow for deleting properties.
This is the cause of a bunch of expected failures in LayoutTests/sputnik.
This fixes the problem by reifying all static functions immediately prior
to the first deletion. Reification is tracked by a flag on the structure,
so properties will no longer 'bounce-back' on later access.
Theoretically there could probably also be an issue with custom accessor
properties, but we probably do not really require any of these to be
Configurable anyway. I'll follow up with a separate patch to address this.
* runtime/ClassInfo.h:
(JSC::ClassInfo::hasStaticProperties):
- detects static property tables.
* runtime/JSObject.cpp:
(JSC::JSObject::deleteProperty):
- call reifyStaticFunctions before deletion.
(JSC::JSObject::reifyStaticFunctions):
- If the class has static functions, set them up now.
* runtime/JSObject.h:
(JSC::JSObject::staticFunctionsReified):
- returns true if static functions have been reified,
and as such should no longer be added.
* runtime/Lookup.cpp:
(JSC::setUpStaticFunctionSlot):
- If static functions have been reified do not add.
* runtime/Lookup.h:
(JSC::HashTable::ConstIterator::ConstIterator):
(JSC::HashTable::ConstIterator::operator->):
(JSC::HashTable::ConstIterator::operator*):
(JSC::HashTable::ConstIterator::operator!=):
(JSC::HashTable::ConstIterator::operator++):
(JSC::HashTable::ConstIterator::skipInvalidKeys):
(JSC::HashTable::begin):
(JSC::HashTable::end):
(JSC::getStaticPropertySlot):
(JSC::getStaticPropertyDescriptor):
(JSC::getStaticFunctionSlot):
(JSC::getStaticFunctionDescriptor):
- setUpStaticFunctionSlot may not add, returns a bool.
(JSC::lookupPut):
- remove redundant branch.