From 2aacb28bb9b24ed7df4769cfa82832765e501e77 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Mon, 26 Nov 2018 12:41:13 -0600 Subject: [PATCH] Fix some proxy tests (#1966) - `Proxy/getOwnPropertyDescriptor/call-parameters.js` Fixes a call to `Object.getOwnPropertyDescriptor` without the prop param. Not actually a huge problem, as the test wasn't depending on it. - `Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined` This test asserted that `function() {}` should throw with the following spec step, which is incorrect, as functions are typed as `Object` in the spec. """ 1. If Type(trapResultObj) is neither Object nor Undefined, throw a TypeError exception. """ --- .../Proxy/getOwnPropertyDescriptor/call-parameters.js | 2 +- .../result-type-is-not-object-nor-undefined.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js b/test/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js index a0df1c3ff0..7e0a51db37 100644 --- a/test/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js +++ b/test/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.js @@ -23,7 +23,7 @@ var handler = { _handler = this; _prop = prop; - return Object.getOwnPropertyDescriptor(t); + return Object.getOwnPropertyDescriptor(t, prop); } }; var p = new Proxy(target, handler); diff --git a/test/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js b/test/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js index e7d3c63847..0e49373584 100644 --- a/test/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js +++ b/test/built-ins/Proxy/getOwnPropertyDescriptor/result-type-is-not-object-nor-undefined.js @@ -18,8 +18,7 @@ var target = { number: 1, symbol: Symbol(), string: '', - boolean: true, - fn: function() {} + boolean: true }; var p = new Proxy(target, { getOwnPropertyDescriptor: function(t, prop) { @@ -42,7 +41,3 @@ assert.throws(TypeError, function() { assert.throws(TypeError, function() { Object.getOwnPropertyDescriptor(p, "boolean"); }); - -assert.throws(TypeError, function() { - Object.getOwnPropertyDescriptor(p, "fn"); -});