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.
  """
This commit is contained in:
Gus Caplan 2018-11-26 12:41:13 -06:00 committed by Leo Balter
parent 2792e66c68
commit 2aacb28bb9
2 changed files with 2 additions and 7 deletions

View File

@ -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);

View File

@ -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");
});