Object properties are undefined in super.call() but not in this.call()
authorticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Oct 2017 12:59:36 +0000 (12:59 +0000)
committerticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Oct 2017 12:59:36 +0000 (12:59 +0000)
commitfa09781f0fbc8c638e7daf9707c6454b5b24fa63
tree207890c79e19137f8c412afa0c5cb1fed2f510e5
parent1e08a97a0690afcfd32ba8188f17d5b388ad15e5
Object properties are undefined in super.call() but not in this.call()
https://bugs.webkit.org/show_bug.cgi?id=177230

Reviewed by Saam Barati.

JSTests:

* stress/super-call-function-subclass.js: Added.
(assert):
(A.prototype.t):
(A):
* stress/super-dot-call-and-apply.js: Added.
(assert):
(A):
(A.prototype.call):
(A.prototype.apply):
(B.prototype.testSuper):
(B):
(const.obj.new.B.string_appeared_here.obj.testSuper.C):
(D.prototype.testSuper):
(D):

Source/JavaScriptCore:

Bytecode generation for "super.call(...)" or "super.apply(...)"
shouldn't be considered as CallFunctionCallDotNode or
ApplyFunctionCallDotNode because they should be considered as common
super property access as any other function. According to spec[1],
"super" is not refering to parent constructor.

[1] - https://tc39.github.io/ecma262/#sec-super-keyword-runtime-semantics-evaluation

* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeFunctionCallNode):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::makeFunctionCallNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/super-call-function-subclass.js [new file with mode: 0644]
JSTests/stress/super-dot-call-and-apply.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/ASTBuilder.h
Source/JavaScriptCore/parser/Parser.cpp
Source/JavaScriptCore/parser/SyntaxChecker.h