Closed Bug 641652 Opened 14 years ago Closed 14 years ago

Object.defineProperty throws an Error not a TypeError

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 598996

People

(Reporter: bruant.d, Unassigned)

Details

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0 Build Identifier: FF4RC1 Test case: ------------------- (function testcase() { var arrObj = []; try { Object.defineProperty(arrObj, "length", {configurable: true}); return false; } catch (e) { alert(e instanceof Error); return e instanceof TypeError; } })(); ------------------- When there is an Object.defineProperty error due to unconfigurable properties, a TypeError should be thrown, not an Error. In the WebConsole and Bugzilla 1.7X.0b1, the Error is an InternalError apparently. Reproducible: Always
Noticed when reviewing Test262 Test 15.2.3.6-4-120 (a bunch of other tests fail for the same reason)
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.