Revise function call & Realm

* Revise Object::getPrototypeFromConstructor. we should get prototype from context of consturctor
* We should pass Optional<Object*> instead of Value with newTarget.
* Give correct prototype value for function prototypes and functions
* Implement %ThrowTypeError% correctly

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2020-04-01 10:40:26 +09:00 committed by Boram Bae
commit 1bd124fc1b
56 changed files with 642 additions and 646 deletions

View file

@ -26,13 +26,13 @@ namespace Escargot {
Object* ScriptGeneratorFunctionObject::createFunctionPrototypeObject(ExecutionState& state)
{
Object* prototype = new Object(state, state.context()->globalObject()->generatorPrototype());
Object* prototype = new Object(state, m_codeBlock->context()->globalObject()->generatorPrototype());
return prototype;
}
class ScriptGeneratorFunctionObjectThisValueBinder {
public:
Value operator()(ExecutionState& calleeState, ScriptGeneratorFunctionObject* self, const Value& thisArgument, bool isStrict)
Value operator()(ExecutionState& callerState, ExecutionState& calleeState, ScriptGeneratorFunctionObject* self, const Value& thisArgument, bool isStrict)
{
Value thisValue = self->thisValue();
if (thisValue.isEmpty()) {