Skip to content

Commit 99c5921

Browse files
Add set_variable_value to opfunc_native_call.
Related issue: #117 JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan [email protected]
1 parent 7d4569a commit 99c5921

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

jerry-core/vm/opcodes-native-call.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ecma_completion_value_t
3131
opfunc_native_call (opcode_t opdata, /**< operation data */
3232
int_data_t *int_data) /**< interpreter context */
3333
{
34-
// const idx_t dst_var_idx = opdata.data.native_call.lhs;
34+
const idx_t dst_var_idx = opdata.data.native_call.lhs;
3535
const idx_t native_call_id_idx = opdata.data.native_call.name;
3636
const idx_t args_number = opdata.data.native_call.arg_list;
3737

@@ -106,7 +106,8 @@ opfunc_native_call (opcode_t opdata, /**< operation data */
106106

107107
mem_heap_free_block (zt_str_p);
108108

109-
ret_value = ecma_make_empty_completion_value ();
109+
ret_value = set_variable_value (int_data, int_data->pos, dst_var_idx,
110+
ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
110111

111112
ECMA_FINALIZE (str_value);
112113
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2015 Samsung Electronics Co., Ltd.
2+
// Copyright 2015 University of Szeged.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
[print(typeof v_1)];

0 commit comments

Comments
 (0)