Extending undefined in class syntax should throw a TypeError
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2015 19:23:24 +0000 (19:23 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 May 2015 19:23:24 +0000 (19:23 +0000)
commit2c4901bfac0f0defca918504b9829f920079894f
tree178a4f82e43f522d39b3e40d046cf0e14511ac5f
parent626193839e9ed73b54dbafa43718dc9f05b9949b
Extending undefined in class syntax should throw a TypeError
https://bugs.webkit.org/show_bug.cgi?id=144284

Reviewed by Darin Adler.

Source/JavaScriptCore:

The bug was caused by op_eq_null evaluating to true when compared to undefined.
Explicitly check op_eq_undefined first to detect the case where we're extending undefined.

We also had bogus test cases checked in class-syntax-extends.html. This patch also fixes them.

* bytecompiler/NodesCodegen.cpp:
(JSC::ClassExprNode::emitBytecode):

LayoutTests:

Fixed the expectation for extending undefined and removed irrelevant test cases for extending undefined
since we'll never get to instantiate these classes now.

* js/class-syntax-extends-expected.txt:
* js/script-tests/class-syntax-extends.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/js/class-syntax-extends-expected.txt
LayoutTests/js/script-tests/class-syntax-extends.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp