diff options
Diffstat (limited to 'deps/v8/test/debugger/debug')
-rw-r--r-- | deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-builtins.js | 19 | ||||
-rw-r--r-- | deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-runtime-check.js | 8 |
2 files changed, 23 insertions, 4 deletions
diff --git a/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-builtins.js b/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-builtins.js index 41f24955a8..e9c996aff6 100644 --- a/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-builtins.js +++ b/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-builtins.js @@ -7,6 +7,7 @@ Debug = debug.Debug var exception = null; +var object = {"foo": "bar"}; var object_with_symbol_key = {[Symbol("a")]: 1}; var object_with_callbacks = { toString: () => "string", valueOf: () => 3}; var symbol_for_a = Symbol.for("a"); @@ -14,6 +15,8 @@ var typed_array = new Uint8Array([1, 2, 3]); var array_buffer = new ArrayBuffer(3); var data_view = new DataView(new ArrayBuffer(8), 0, 8); var array = [1,2,3]; +var pure_function = function(x) { return x * x; }; +var unpure_function = function(x) { array.push(x); }; function listener(event, exec_state, event_data, data) { if (event != Debug.DebugEvent.Break) return; @@ -219,6 +222,22 @@ function listener(event, exec_state, event_data, data) { success("a", `Symbol.keyFor(symbol_for_a)`); success("Symbol(a)", `symbol_for_a.valueOf().toString()`); success("Symbol(a)", `symbol_for_a[Symbol.toPrimitive]().toString()`); + + // Test Reflect functions. + success(4, `Reflect.apply(pure_function, undefined, [2])`); + fail(`Reflect.apply(unpure_function, undefined, [2])`); + success("foo", `Reflect.construct(String, ["foo"]).toString()`); + fail(`Reflect.construct(unpure_function, ["foo"])`); + success("bar", `Reflect.getOwnPropertyDescriptor(object, "foo").value`); + success(true, `Reflect.getPrototypeOf(object) === Object.prototype`); + success(true, `Reflect.has(object, "foo")`); + success(true, `Reflect.isExtensible(object)`); + success("foo", `Reflect.ownKeys(object)[0]`); + fail(`Reflect.defineProperty(object, "baz", {})`); + fail(`Reflect.deleteProperty(object, "foo")`); + fail(`Reflect.preventExtensions(object)`); + fail(`Reflect.set(object, "great", "expectations")`); + fail(`Reflect.setPrototypeOf(object, Array.prototype)`); } catch (e) { exception = e; print(e, e.stack); diff --git a/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-runtime-check.js b/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-runtime-check.js index 7a0f373be7..de3990d09b 100644 --- a/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-runtime-check.js +++ b/deps/v8/test/debugger/debug/side-effect/debug-evaluate-no-side-effect-runtime-check.js @@ -11,7 +11,7 @@ success(10, `(function(){ return x; })()`); -// StaNamedProperty +// SetNamedProperty var a = {name: 'foo'}; function set_name(a) { a.name = 'bar'; @@ -21,7 +21,7 @@ function set_name(a) { fail(`set_name(a)`); success('bar', `set_name({name: 'foo'})`); -// StaNamedOwnProperty +// DefineNamedOwnProperty var name_value = 'value'; function create_object_literal() { var obj = {name: name_value}; @@ -30,7 +30,7 @@ function create_object_literal() { success('value', `create_object_literal()`); -// StaKeyedProperty +// SetKeyedProperty var arrayValue = 1; function create_array_literal() { return [arrayValue]; @@ -52,7 +52,7 @@ var array = [1,2,3]; fail(`array.length = 2`); success(2, `[1,2,3].length = 2`); -// StaDataPropertyInLiteral +// DefineKeyedOwnPropertyInLiteral function return_literal_with_data_property(a) { return {[a] : 1}; } |