more vm tests
This commit is contained in:
1
vm_test/arrow_default.txt
Normal file
1
vm_test/arrow_default.txt
Normal file
@@ -0,0 +1 @@
|
||||
var f = (x = 10) => x; f()
|
||||
1
vm_test/arrow_no_param.txt
Normal file
1
vm_test/arrow_no_param.txt
Normal file
@@ -0,0 +1 @@
|
||||
var f = () => 42; f()
|
||||
1
vm_test/assign_add.txt
Normal file
1
vm_test/assign_add.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x += 3; x
|
||||
1
vm_test/assign_and.txt
Normal file
1
vm_test/assign_and.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 7; x &= 3; x
|
||||
1
vm_test/assign_div.txt
Normal file
1
vm_test/assign_div.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 6; x /= 2; x
|
||||
1
vm_test/assign_land.txt
Normal file
1
vm_test/assign_land.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x &&= 10; x
|
||||
1
vm_test/assign_lor.txt
Normal file
1
vm_test/assign_lor.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 0; x ||= 10; x
|
||||
1
vm_test/assign_mod.txt
Normal file
1
vm_test/assign_mod.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 7; x %= 3; x
|
||||
1
vm_test/assign_mul.txt
Normal file
1
vm_test/assign_mul.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x *= 3; x
|
||||
1
vm_test/assign_nullish.txt
Normal file
1
vm_test/assign_nullish.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = null; x ??= 10; x
|
||||
1
vm_test/assign_or.txt
Normal file
1
vm_test/assign_or.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x |= 2; x
|
||||
1
vm_test/assign_power.txt
Normal file
1
vm_test/assign_power.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 2; x **= 3; x
|
||||
1
vm_test/assign_shl.txt
Normal file
1
vm_test/assign_shl.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 2; x <<= 3; x
|
||||
1
vm_test/assign_shr.txt
Normal file
1
vm_test/assign_shr.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 8; x >>= 2; x
|
||||
1
vm_test/assign_shru.txt
Normal file
1
vm_test/assign_shru.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = -8; x >>>= 2; x
|
||||
1
vm_test/assign_sub.txt
Normal file
1
vm_test/assign_sub.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x -= 3; x
|
||||
1
vm_test/assign_xor.txt
Normal file
1
vm_test/assign_xor.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x ^= 3; x
|
||||
1
vm_test/chained_assign.txt
Normal file
1
vm_test/chained_assign.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x, y; x = y = 5; x + y
|
||||
1
vm_test/comment_block.txt
Normal file
1
vm_test/comment_block.txt
Normal file
@@ -0,0 +1 @@
|
||||
/* comment */ 5
|
||||
1
vm_test/comment_multi.txt
Normal file
1
vm_test/comment_multi.txt
Normal file
@@ -0,0 +1 @@
|
||||
1 /* a */ + /* b */ 2
|
||||
1
vm_test/empty_statement.txt
Normal file
1
vm_test/empty_statement.txt
Normal file
@@ -0,0 +1 @@
|
||||
;;; 5
|
||||
1
vm_test/func_expr.txt
Normal file
1
vm_test/func_expr.txt
Normal file
@@ -0,0 +1 @@
|
||||
var f = function(x) { return x * 2 }; f(3)
|
||||
1
vm_test/func_iife.txt
Normal file
1
vm_test/func_iife.txt
Normal file
@@ -0,0 +1 @@
|
||||
(function(x) { return x * 2 })(5)
|
||||
1
vm_test/func_recursive.txt
Normal file
1
vm_test/func_recursive.txt
Normal file
@@ -0,0 +1 @@
|
||||
function fac(n) { if (n <= 1) return 1; return n * fac(n - 1) }; fac(5)
|
||||
1
vm_test/label_break.txt
Normal file
1
vm_test/label_break.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 0; outer: { x = 1; break outer; x = 2 }; x
|
||||
1
vm_test/label_continue.txt
Normal file
1
vm_test/label_continue.txt
Normal file
@@ -0,0 +1 @@
|
||||
var s = 0; outer: for (var i = 0; i < 3; i++) { for (var j = 0; j < 3; j++) { if (j == 1) continue outer; s = s + 1 } }; s
|
||||
1
vm_test/multi_var.txt
Normal file
1
vm_test/multi_var.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 1, y = 2; x + y
|
||||
1
vm_test/nested_block.txt
Normal file
1
vm_test/nested_block.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 1; { var y = 2; { var z = 3; x = x + y + z } }; x
|
||||
1
vm_test/num_binary.txt
Normal file
1
vm_test/num_binary.txt
Normal file
@@ -0,0 +1 @@
|
||||
0b1010
|
||||
1
vm_test/num_exp.txt
Normal file
1
vm_test/num_exp.txt
Normal file
@@ -0,0 +1 @@
|
||||
1e3
|
||||
1
vm_test/num_float.txt
Normal file
1
vm_test/num_float.txt
Normal file
@@ -0,0 +1 @@
|
||||
3.14
|
||||
1
vm_test/num_hex.txt
Normal file
1
vm_test/num_hex.txt
Normal file
@@ -0,0 +1 @@
|
||||
0xff
|
||||
1
vm_test/num_octal.txt
Normal file
1
vm_test/num_octal.txt
Normal file
@@ -0,0 +1 @@
|
||||
0o17
|
||||
1
vm_test/num_underscore.txt
Normal file
1
vm_test/num_underscore.txt
Normal file
@@ -0,0 +1 @@
|
||||
1_000_000
|
||||
1
vm_test/op_bitwise_not.txt
Normal file
1
vm_test/op_bitwise_not.txt
Normal file
@@ -0,0 +1 @@
|
||||
~5
|
||||
1
vm_test/op_bitwise_or.txt
Normal file
1
vm_test/op_bitwise_or.txt
Normal file
@@ -0,0 +1 @@
|
||||
5 | 2
|
||||
1
vm_test/op_bitwise_xor.txt
Normal file
1
vm_test/op_bitwise_xor.txt
Normal file
@@ -0,0 +1 @@
|
||||
5 ^ 3
|
||||
1
vm_test/op_comma.txt
Normal file
1
vm_test/op_comma.txt
Normal file
@@ -0,0 +1 @@
|
||||
(1, 2, 3)
|
||||
1
vm_test/op_compare_eq.txt
Normal file
1
vm_test/op_compare_eq.txt
Normal file
@@ -0,0 +1 @@
|
||||
3 == 3
|
||||
1
vm_test/op_compare_gte.txt
Normal file
1
vm_test/op_compare_gte.txt
Normal file
@@ -0,0 +1 @@
|
||||
5 >= 5
|
||||
1
vm_test/op_compare_lt.txt
Normal file
1
vm_test/op_compare_lt.txt
Normal file
@@ -0,0 +1 @@
|
||||
3 < 5
|
||||
1
vm_test/op_compare_lte.txt
Normal file
1
vm_test/op_compare_lte.txt
Normal file
@@ -0,0 +1 @@
|
||||
3 <= 3
|
||||
1
vm_test/op_compare_neq.txt
Normal file
1
vm_test/op_compare_neq.txt
Normal file
@@ -0,0 +1 @@
|
||||
3 != 4
|
||||
1
vm_test/op_decrement_post.txt
Normal file
1
vm_test/op_decrement_post.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x--; x
|
||||
1
vm_test/op_decrement_pre.txt
Normal file
1
vm_test/op_decrement_pre.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; --x
|
||||
1
vm_test/op_delete.txt
Normal file
1
vm_test/op_delete.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {x: 1}; delete o.x; o.x
|
||||
1
vm_test/op_in.txt
Normal file
1
vm_test/op_in.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {x: 1}; "x" in o
|
||||
1
vm_test/op_increment_post.txt
Normal file
1
vm_test/op_increment_post.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; x++; x
|
||||
1
vm_test/op_increment_pre.txt
Normal file
1
vm_test/op_increment_pre.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 5; ++x
|
||||
1
vm_test/op_logical_not.txt
Normal file
1
vm_test/op_logical_not.txt
Normal file
@@ -0,0 +1 @@
|
||||
!false
|
||||
1
vm_test/op_logical_or.txt
Normal file
1
vm_test/op_logical_or.txt
Normal file
@@ -0,0 +1 @@
|
||||
false || true
|
||||
1
vm_test/op_nullish.txt
Normal file
1
vm_test/op_nullish.txt
Normal file
@@ -0,0 +1 @@
|
||||
null ?? 5
|
||||
1
vm_test/op_power.txt
Normal file
1
vm_test/op_power.txt
Normal file
@@ -0,0 +1 @@
|
||||
2 ** 3
|
||||
1
vm_test/op_shift_left.txt
Normal file
1
vm_test/op_shift_left.txt
Normal file
@@ -0,0 +1 @@
|
||||
2 << 3
|
||||
1
vm_test/op_shift_right.txt
Normal file
1
vm_test/op_shift_right.txt
Normal file
@@ -0,0 +1 @@
|
||||
8 >> 2
|
||||
1
vm_test/op_shift_right_unsigned.txt
Normal file
1
vm_test/op_shift_right_unsigned.txt
Normal file
@@ -0,0 +1 @@
|
||||
-8 >>> 2
|
||||
1
vm_test/op_typeof.txt
Normal file
1
vm_test/op_typeof.txt
Normal file
@@ -0,0 +1 @@
|
||||
typeof 5
|
||||
1
vm_test/op_unary_minus.txt
Normal file
1
vm_test/op_unary_minus.txt
Normal file
@@ -0,0 +1 @@
|
||||
-5
|
||||
1
vm_test/op_unary_plus.txt
Normal file
1
vm_test/op_unary_plus.txt
Normal file
@@ -0,0 +1 @@
|
||||
+"5"
|
||||
1
vm_test/op_void.txt
Normal file
1
vm_test/op_void.txt
Normal file
@@ -0,0 +1 @@
|
||||
void 0
|
||||
1
vm_test/optional_bracket.txt
Normal file
1
vm_test/optional_bracket.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {a: 1}; o?.["a"]
|
||||
1
vm_test/optional_call.txt
Normal file
1
vm_test/optional_call.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {f: () => 1}; o.f?.()
|
||||
1
vm_test/optional_null.txt
Normal file
1
vm_test/optional_null.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = null; o?.a
|
||||
1
vm_test/optional_prop.txt
Normal file
1
vm_test/optional_prop.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {a: 1}; o?.a
|
||||
1
vm_test/paren_precedence.txt
Normal file
1
vm_test/paren_precedence.txt
Normal file
@@ -0,0 +1 @@
|
||||
(1 + 2) * 3
|
||||
1
vm_test/record_chain.txt
Normal file
1
vm_test/record_chain.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {a: {b: {c: 1}}}; o.a.b.c
|
||||
1
vm_test/record_nested.txt
Normal file
1
vm_test/record_nested.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {a: {b: 1}}; o.a.b
|
||||
1
vm_test/record_numeric_key.txt
Normal file
1
vm_test/record_numeric_key.txt
Normal file
@@ -0,0 +1 @@
|
||||
var o = {1: "one"}; o[1]
|
||||
1
vm_test/string_escape.txt
Normal file
1
vm_test/string_escape.txt
Normal file
@@ -0,0 +1 @@
|
||||
"hello\nworld"
|
||||
1
vm_test/string_unicode.txt
Normal file
1
vm_test/string_unicode.txt
Normal file
@@ -0,0 +1 @@
|
||||
"\u0041"
|
||||
1
vm_test/try_catch_finally.txt
Normal file
1
vm_test/try_catch_finally.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 1; try { throw 0 } catch(e) { x = 2 } finally { x = x + 1 }; x
|
||||
1
vm_test/try_finally.txt
Normal file
1
vm_test/try_finally.txt
Normal file
@@ -0,0 +1 @@
|
||||
var x = 1; try { x = 2 } finally { x = 3 }; x
|
||||
Reference in New Issue
Block a user