Call property should handle ECMA_SIMPLE_VALUE_REGISTER_REF. (#1631)

Fixes #1624.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg 2017-03-03 12:23:18 +01:00 committed by GitHub
parent f780f2b8dc
commit ca2b057356
2 changed files with 29 additions and 1 deletions

View File

@ -364,7 +364,13 @@ opfunc_call (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
this_value = stack_top_p[-3];
if (vm_get_implicit_this_value (&this_value))
if (this_value == ecma_make_simple_value (ECMA_SIMPLE_VALUE_REGISTER_REF))
{
/* Lexical environment cannot be 'this' value. */
stack_top_p[-2] = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
this_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);
}
else if (vm_get_implicit_this_value (&this_value))
{
ecma_free_value (stack_top_p[-3]);
stack_top_p[-3] = this_value;

View File

@ -0,0 +1,22 @@
// Copyright JS Foundation and other contributors, http://js.foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
with ({}) {
a = function (b)
{
var init;
init();
}
}
a();