2015-11-24 20:12:55 +01:00
|
|
|
// Copyright (C) 2015 André Bargull. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
2020-04-14 20:43:17 +02:00
|
|
|
esid: sec-proxy.revocable
|
2015-11-24 20:12:55 +01:00
|
|
|
description: Proxy Revocation functions are not constructors
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2015-11-24 20:12:55 +01:00
|
|
|
17 ECMAScript Standard Built-in Objects:
|
|
|
|
Built-in function objects that are not identified as constructors do not
|
|
|
|
implement the [[Construct]] internal method unless otherwise specified
|
|
|
|
in the description of a particular function.
|
2020-04-14 20:43:17 +02:00
|
|
|
includes: [isConstructor.js]
|
2020-10-02 16:46:09 +02:00
|
|
|
features: [Proxy, Reflect.construct, arrow-function]
|
2015-11-24 20:12:55 +01:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var revocationFunction = Proxy.revocable({}, {}).revoke;
|
|
|
|
|
2020-10-02 16:46:09 +02:00
|
|
|
assert.sameValue(
|
|
|
|
Object.prototype.hasOwnProperty.call(revocationFunction, "prototype"),
|
|
|
|
false,
|
|
|
|
'Object.prototype.hasOwnProperty.call(revocationFunction, "prototype") must return false'
|
|
|
|
);
|
|
|
|
assert.sameValue(isConstructor(revocationFunction), false, 'isConstructor(revocationFunction) must return false');
|
|
|
|
assert.throws(TypeError, () => {
|
|
|
|
new revocationFunction();
|
2024-03-23 02:28:44 +01:00
|
|
|
});
|
2020-10-02 16:46:09 +02:00
|
|
|
|
|
|
|
|