Add set_variable_value to opfunc_native_call.

Related issue: #117

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan 2015-06-19 21:16:20 +03:00
parent 611811678e
commit d1055f98e5
2 changed files with 20 additions and 2 deletions

View File

@ -31,9 +31,10 @@ ecma_completion_value_t
opfunc_native_call (opcode_t opdata, /**< operation data */
int_data_t *int_data) /**< interpreter context */
{
// const idx_t dst_var_idx = opdata.data.native_call.lhs;
const idx_t dst_var_idx = opdata.data.native_call.lhs;
const idx_t native_call_id_idx = opdata.data.native_call.name;
const idx_t args_number = opdata.data.native_call.arg_list;
const opcode_counter_t lit_oc = int_data->pos;
JERRY_ASSERT (native_call_id_idx < OPCODE_NATIVE_CALL__COUNT);
@ -106,7 +107,8 @@ opfunc_native_call (opcode_t opdata, /**< operation data */
mem_heap_free_block (zt_str_p);
ret_value = ecma_make_empty_completion_value ();
ret_value = set_variable_value (int_data, lit_oc, dst_var_idx,
ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
ECMA_FINALIZE (str_value);
}

View File

@ -0,0 +1,16 @@
// Copyright 2015 Samsung Electronics Co., Ltd.
// Copyright 2015 University of Szeged.
//
// 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.
[print(typeof v_1)];