public FunctionEnvironment([NotNull] ScriptFunctionObject function, ThisBindingStatus thisBindingStatus, ScriptObject homeObject, ScriptObject newTarget) : base(function.Agent) { FunctionObject = function; this.thisBindingStatus = thisBindingStatus; this.homeObject = homeObject; NewTarget = newTarget; }
public JsValue BindThisValue(JsValue value) { if (_thisBindingStatus == ThisBindingStatus.Initialized) { ExceptionHelper.ThrowReferenceError <JsValue>(_engine); } _thisValue = value; _thisBindingStatus = ThisBindingStatus.Initialized; return(value); }
public JsValue BindThisValue(JsValue value) { if (_thisBindingStatus == ThisBindingStatus.Initialized) { ExceptionHelper.ThrowReferenceError(_functionObject._realm, (string)null); } _thisValue = value; _thisBindingStatus = ThisBindingStatus.Initialized; return(value); }
public void BindThisValue(ScriptValue value) { //https://tc39.github.io/ecma262/#sec-bindthisvalue Debug.Assert(thisBindingStatus != ThisBindingStatus.Lexical); if (thisBindingStatus == ThisBindingStatus.Initialised) { throw FunctionObject.Agent.CreateReferenceError(); } thisValue = value; thisBindingStatus = ThisBindingStatus.Initialised; }
public FunctionEnvironmentRecord( Engine engine, FunctionInstance functionObject, JsValue newTarget) : base(engine) { _functionObject = functionObject; _newTarget = newTarget; if (functionObject is ArrowFunctionInstance) { _thisBindingStatus = ThisBindingStatus.Lexical; } else { _thisBindingStatus = ThisBindingStatus.Uninitialized; } }