Debian Codegraph @

js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/prop-desc.js

raw
1 // |reftest| skip -- legacy-regexp is not supported
2 // Copyright (C) 2020 ExE Boss. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 esid: pending
6 description: Property descriptor for RegExp.lastMatch
7 info: |
8 RegExp.lastMatch is an accessor property with attributes:
9 {
10 [[Enumerable]]: false,
11 [[Configurable]]: true,
12 [[Set]]: undefined,
13 }
14
15 get RegExp.lastMatch
16
17 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastMatch]]).
18 includes: [propertyHelper.js]
19 features: [legacy-regexp]
20 ---*/
21
22 var desc = Object.getOwnPropertyDescriptor(RegExp, "lastMatch");
23
24 assert.sameValue(desc.set, undefined, "`set` property");
25 assert.sameValue(typeof desc.get, "function", "`get` property");
26
27 verifyProperty(RegExp, "lastMatch", {
28 enumerable: false,
29 configurable: true
30 });
31
32 desc = Object.getOwnPropertyDescriptor(RegExp, "$&");
33
34 assert.sameValue(desc.set, undefined, "`set` property");
35 assert.sameValue(typeof desc.get, "function", "`get` property");
36
37 verifyProperty(RegExp, "$&", {
38 enumerable: false,
39 configurable: true
40 });
41
42 reportCompare(0, 0);