In
c75a8fc6d534 "GLOBAL GET" instruction was introduced to handle unresolved
references. The issue was that the "GLOBAL GET" instruction erroneously
used the assignment variable index as a destination index.
The result was that a variable was assigned the retval of a "GLOBAL GET"
instruction.
The fix is to use a separate temporary index for "GLOBAL GET".
This closes #289 issue on GitHub.
njs_vmcode_prop_get_t *prop_get;
const njs_lexer_entry_t *lex_entry;
- index = njs_generate_dest_index(vm, generator, node);
+ index = njs_generate_temp_index_get(vm, generator, node);
if (njs_slow_path(index == NJS_INDEX_ERROR)) {
return NJS_ERROR;
}
{ njs_str("for (;1-;) {}"),
njs_str("SyntaxError: Unexpected token \";\" in 1") },
+
+ { njs_str("var str = String(str); str"),
+ njs_str("undefined") },
+
+ { njs_str("var t = \"123\"; t = parseInt(t); t"),
+ njs_str("123") },
};