Extending null should set __proto__ to null
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 01:59:31 +0000 (01:59 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Mar 2015 01:59:31 +0000 (01:59 +0000)
commit6d174a989f1f18855f151cf060020e2e4f78445f
tree58e7b2e3260b39c2f3c52ee308ef8ce79cdf6476
parent56da2a4d1353bf781ca2d513a608526612116b24
Extending null should set __proto__ to null
https://bugs.webkit.org/show_bug.cgi?id=142882

Reviewed by Geoffrey Garen and Benjamin Poulain.

Source/JavaScriptCore:

Set Derived.prototype.__proto__ to null when extending null.

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

LayoutTests:

Added more test cases for extending from null, and added checks for prototypes.

Also rebaselined existing tests.

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

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