mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Implement GeneratorFunction constructor (#350)
* Fix some bugs * Pass more test262 tests Signed-off-by: Boram Bae <boram21.bae@samsung.com>
This commit is contained in:
parent
8c1cd3b2b5
commit
de65761ac7
8 changed files with 27 additions and 25 deletions
|
|
@ -2387,12 +2387,12 @@ NEVER_INLINE void ByteCodeInterpreter::classOperation(ExecutionState& state, Cre
|
|||
} else {
|
||||
if (!heritagePresent) {
|
||||
Value argv[] = { String::emptyString, String::emptyString };
|
||||
auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true);
|
||||
auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false);
|
||||
functionSource.codeBlock->setAsClassConstructor();
|
||||
constructor = new ScriptClassConstructorFunctionObject(state, functionSource.codeBlock, functionSource.outerEnvironment, proto);
|
||||
} else {
|
||||
Value argv[] = { new ASCIIString("...args"), new ASCIIString("super(...args)") };
|
||||
auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true);
|
||||
auto functionSource = FunctionObject::createFunctionSourceFromScriptSource(state, state.context()->staticStrings().constructor, 1, &argv[0], argv[1], true, false);
|
||||
functionSource.codeBlock->setAsClassConstructor();
|
||||
functionSource.codeBlock->setAsDerivedClassConstructor();
|
||||
constructor = new ScriptClassConstructorFunctionObject(state, functionSource.codeBlock, functionSource.outerEnvironment, proto);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue