mirror of
https://github.com/tc39/test262.git
synced 2025-07-14 09:34:37 +02:00
Merge pull request #1006 from leobalter/fix-info
Update RegExp#dotAll tests
This commit is contained in:
commit
a09f857ed8
10
test/built-ins/RegExp/prototype/dotAll/length.js
vendored
10
test/built-ins/RegExp/prototype/dotAll/length.js
vendored
@ -2,7 +2,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
get RegExp.prototype.dotAll.length is 0.
|
get RegExp.prototype.dotAll.length is 0.
|
||||||
info: >
|
info: >
|
||||||
@ -27,6 +27,8 @@ var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll");
|
|||||||
|
|
||||||
assert.sameValue(desc.get.length, 0);
|
assert.sameValue(desc.get.length, 0);
|
||||||
|
|
||||||
verifyNotEnumerable(desc.get, "length");
|
verifyProperty(desc.get, "length", {
|
||||||
verifyNotWritable(desc.get, "length");
|
enumerable: false,
|
||||||
verifyConfigurable(desc.get, "length");
|
writable: false,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
16
test/built-ins/RegExp/prototype/dotAll/name.js
vendored
16
test/built-ins/RegExp/prototype/dotAll/name.js
vendored
@ -1,7 +1,7 @@
|
|||||||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
RegExp.prototype.dotAll name
|
RegExp.prototype.dotAll name
|
||||||
info: >
|
info: >
|
||||||
@ -13,13 +13,15 @@ includes: [propertyHelper.js]
|
|||||||
features: [regexp-dotall]
|
features: [regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll');
|
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll");
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
descriptor.get.name,
|
desc.get.name,
|
||||||
'get dotAll'
|
"get dotAll"
|
||||||
);
|
);
|
||||||
|
|
||||||
verifyNotEnumerable(descriptor.get, 'name');
|
verifyProperty(desc.get, "name", {
|
||||||
verifyNotWritable(descriptor.get, 'name');
|
enumerable: false,
|
||||||
verifyConfigurable(descriptor.get, 'name');
|
writable: false,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
`pending` property descriptor
|
`pending` property descriptor
|
||||||
info: >
|
info: |
|
||||||
RegExp.prototype.dotAll is an accessor property whose set accessor
|
RegExp.prototype.dotAll is an accessor property whose set accessor
|
||||||
function is undefined.
|
function is undefined.
|
||||||
|
|
||||||
|
17 ECMAScript Standard Built-in Objects
|
||||||
|
|
||||||
|
Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes
|
||||||
|
{ [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. If only a get
|
||||||
|
accessor function is described, the set accessor function is the default value, undefined. If
|
||||||
|
only a set accessor is described the get accessor is the default value, undefined.
|
||||||
|
includes: [propertyHelper.js]
|
||||||
features: [regexp-dotall]
|
features: [regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll');
|
var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll");
|
||||||
|
|
||||||
assert.sameValue(desc.set, undefined);
|
assert.sameValue(desc.set, undefined);
|
||||||
assert.sameValue(typeof desc.get, 'function');
|
assert.sameValue(typeof desc.get, "function");
|
||||||
|
|
||||||
|
verifyProperty(RegExp.prototype, "dotAll", {
|
||||||
|
enumerable: false,
|
||||||
|
configurable: true,
|
||||||
|
});
|
||||||
|
@ -2,15 +2,16 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: Invoked on an object without an [[OriginalFlags]] internal slot
|
description: Invoked on an object without an [[OriginalFlags]] internal slot
|
||||||
esid: pending
|
|
||||||
info: >
|
info: >
|
||||||
get RegExp.prototype.dotAll
|
get RegExp.prototype.dotAll
|
||||||
|
|
||||||
1. Let R be the this value.
|
1. Let R be the this value.
|
||||||
2. If Type(R) is not Object, throw a TypeError exception.
|
2. If Type(R) is not Object, throw a TypeError exception.
|
||||||
3. If R does not have an [[OriginalFlags]] internal slot, throw a TypeError
|
3. If R does not have an [[OriginalFlags]] internal slot, then
|
||||||
exception.
|
a. If SameValue(R, %RegExpPrototype%) is true, return undefined.
|
||||||
|
b. Otherwise, throw a TypeError exception.
|
||||||
features: [regexp-dotall]
|
features: [regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
`dotAll` accessor invoked on a non-object value
|
`dotAll` accessor invoked on a non-object value
|
||||||
esid: pending
|
|
||||||
info: >
|
info: >
|
||||||
get RegExp.prototype.dotAll
|
get RegExp.prototype.dotAll
|
||||||
|
|
||||||
@ -13,28 +13,28 @@ info: >
|
|||||||
features: [Symbol, regexp-dotall]
|
features: [Symbol, regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll').get;
|
var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll").get;
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(undefined);
|
dotAll.call(undefined);
|
||||||
});
|
}, "undefined");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(null);
|
dotAll.call(null);
|
||||||
});
|
}, "null");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(true);
|
dotAll.call(true);
|
||||||
});
|
}, "true");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call('string');
|
dotAll.call("string");
|
||||||
});
|
}, "string");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(Symbol('s'));
|
dotAll.call(Symbol("s"));
|
||||||
});
|
}, "symbol");
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
dotAll.call(4);
|
dotAll.call(4);
|
||||||
});
|
}, "number");
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: pending
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
Return value of `undefined` when the "this" value is the RegExp prototype
|
Return value of `undefined` when the "this" value is the RegExp prototype
|
||||||
object
|
object
|
||||||
@ -13,6 +14,6 @@ info: |
|
|||||||
features: [regexp-dotall]
|
features: [regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll').get;
|
var get = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll").get;
|
||||||
|
|
||||||
assert.sameValue(get.call(RegExp.prototype), undefined);
|
assert.sameValue(get.call(RegExp.prototype), undefined);
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
|
esid: sec-get-regexp.prototype.dotall
|
||||||
description: >
|
description: >
|
||||||
`dotAll` accessor function invoked on a RegExp instance
|
`dotAll` accessor function invoked on a RegExp instance
|
||||||
esid: pending
|
|
||||||
info: >
|
info: >
|
||||||
21.2.5.12 get RegExp.prototype.dotAll
|
21.2.5.12 get RegExp.prototype.dotAll
|
||||||
|
|
||||||
@ -14,26 +14,26 @@ info: >
|
|||||||
features: [regexp-dotall]
|
features: [regexp-dotall]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(/./.dotAll, false);
|
assert.sameValue(/./.dotAll, false, "/./.dotAll");
|
||||||
assert.sameValue(/./i.dotAll, false);
|
assert.sameValue(/./i.dotAll, false, "/./i.dotAll");
|
||||||
assert.sameValue(/./g.dotAll, false);
|
assert.sameValue(/./g.dotAll, false, "/./g.dotAll");
|
||||||
assert.sameValue(/./y.dotAll, false);
|
assert.sameValue(/./y.dotAll, false, "/./y.dotAll");
|
||||||
assert.sameValue(/./m.dotAll, false);
|
assert.sameValue(/./m.dotAll, false, "/./m.dotAll");
|
||||||
|
|
||||||
assert.sameValue(/./s.dotAll, true);
|
assert.sameValue(/./s.dotAll, true, "/./s.dotAll");
|
||||||
assert.sameValue(/./is.dotAll, true);
|
assert.sameValue(/./is.dotAll, true, "/./is.dotAll");
|
||||||
assert.sameValue(/./sg.dotAll, true);
|
assert.sameValue(/./sg.dotAll, true, "/./sg.dotAll");
|
||||||
assert.sameValue(/./is.dotAll, true);
|
assert.sameValue(/./sy.dotAll, true, "/./sy.dotAll");
|
||||||
assert.sameValue(/./ms.dotAll, true);
|
assert.sameValue(/./ms.dotAll, true, "/./ms.dotAll");
|
||||||
|
|
||||||
assert.sameValue(new RegExp(".", "").dotAll, false);
|
assert.sameValue(new RegExp(".", "").dotAll, false, "new RegExp('.', '').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "i").dotAll, false);
|
assert.sameValue(new RegExp(".", "i").dotAll, false, "new RegExp('.', 'i').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "g").dotAll, false);
|
assert.sameValue(new RegExp(".", "g").dotAll, false, "new RegExp('.', 'g').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "y").dotAll, false);
|
assert.sameValue(new RegExp(".", "y").dotAll, false, "new RegExp('.', 'y').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "m").dotAll, false);
|
assert.sameValue(new RegExp(".", "m").dotAll, false, "new RegExp('.', 'm').dotAll");
|
||||||
|
|
||||||
assert.sameValue(new RegExp(".", "s").dotAll, true);
|
assert.sameValue(new RegExp(".", "s").dotAll, true, "new RegExp('.', 's').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "is").dotAll, true);
|
assert.sameValue(new RegExp(".", "is").dotAll, true, "new RegExp('.', 'is').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "sg").dotAll, true);
|
assert.sameValue(new RegExp(".", "sg").dotAll, true, "new RegExp('.', 'sg').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "is").dotAll, true);
|
assert.sameValue(new RegExp(".", "sy").dotAll, true, "new RegExp('.', 'sy').dotAll");
|
||||||
assert.sameValue(new RegExp(".", "ms").dotAll, true);
|
assert.sameValue(new RegExp(".", "ms").dotAll, true, "new RegExp('.', 'ms').dotAll");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user