mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Revise function call processes (#347)
* Revise [[call]], [[construct]] as described in spec
* Remove m_homeObject in FunctionObject.
* Implement ScriptClass{Constructor, Method}FunctionObject
this subclass is used for saving [[homeObject]] and implement [[call]], [[consturct]]
* Add more(NewTargetBinder, ReturnValueBinder) into FunctionObjectProcessCallGenerator
* Remove feCounter in ByteCodeGenerationProcess. in ES6, function expression order & evaluation order can differ
* Add CallSuper ByteCode for interpret `super()` in class constructor
* Remove isOngoingSuperCall in ExecutionState
* Remove BuiltinFunctionObject. that was unnecessary
Signed-off-by: seonghyun kim <sh8281.kim@samsung.com>
This commit is contained in:
parent
467841c5df
commit
43f442c560
71 changed files with 1371 additions and 948 deletions
51
src/runtime/ScriptClassMethodFunctionObject.h
Normal file
51
src/runtime/ScriptClassMethodFunctionObject.h
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2019-present Samsung Electronics Co., Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
||||
* USA
|
||||
*/
|
||||
|
||||
#ifndef __EscargotScriptClassMethodFunctionObject__
|
||||
#define __EscargotScriptClassMethodFunctionObject__
|
||||
|
||||
#include "runtime/ScriptFunctionObject.h"
|
||||
|
||||
namespace Escargot {
|
||||
|
||||
// {method, get, set} of object literal also uses this class
|
||||
class ScriptClassMethodFunctionObject : public ScriptFunctionObject {
|
||||
public:
|
||||
ScriptClassMethodFunctionObject(ExecutionState& state, CodeBlock* codeBlock, LexicalEnvironment* outerEnvironment, Object* homeObject)
|
||||
: ScriptFunctionObject(state, codeBlock, outerEnvironment, false, codeBlock->isGenerator())
|
||||
, m_homeObject(homeObject)
|
||||
{
|
||||
}
|
||||
|
||||
bool isConstructor() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual Object* homeObject() override
|
||||
{
|
||||
return m_homeObject;
|
||||
}
|
||||
|
||||
private:
|
||||
Object* m_homeObject;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue