Skip to content

Commit 59ece8d

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 59ece8d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ 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;
37+
const opcode_counter_t lit_oc = int_data->pos;
3738

3839
JERRY_ASSERT (native_call_id_idx < OPCODE_NATIVE_CALL__COUNT);
3940

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

107108
mem_heap_free_block (zt_str_p);
108109

109-
ret_value = ecma_make_empty_completion_value ();
110+
ret_value = set_variable_value (int_data, lit_oc, dst_var_idx,
111+
ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED));
110112

111113
ECMA_FINALIZE (str_value);
112114
}
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)