From 028d984c0e8acabf09f5746ecb6b0fe9265d8473 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Thu, 27 Apr 2017 18:35:37 -0400 Subject: [PATCH] Update RegExp#dotAll tests --- .../RegExp/prototype/dotAll/length.js | 8 ++-- .../built-ins/RegExp/prototype/dotAll/name.js | 14 ++++--- .../RegExp/prototype/dotAll/prop-desc.js | 25 +++++++++--- .../prototype/dotAll/this-val-non-obj.js | 18 ++++----- .../dotAll/this-val-regexp-prototype.js | 2 +- .../prototype/dotAll/this-val-regexp.js | 40 +++++++++---------- 6 files changed, 62 insertions(+), 45 deletions(-) diff --git a/test/built-ins/RegExp/prototype/dotAll/length.js b/test/built-ins/RegExp/prototype/dotAll/length.js index e063b93f57..912e6a3db4 100644 --- a/test/built-ins/RegExp/prototype/dotAll/length.js +++ b/test/built-ins/RegExp/prototype/dotAll/length.js @@ -27,6 +27,8 @@ var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll"); assert.sameValue(desc.get.length, 0); -verifyNotEnumerable(desc.get, "length"); -verifyNotWritable(desc.get, "length"); -verifyConfigurable(desc.get, "length"); +verifyProperty(desc.get, "length", { + enumerable: false, + writable: false, + configurable: true, +}); diff --git a/test/built-ins/RegExp/prototype/dotAll/name.js b/test/built-ins/RegExp/prototype/dotAll/name.js index 97fe7adc58..deda1863a4 100644 --- a/test/built-ins/RegExp/prototype/dotAll/name.js +++ b/test/built-ins/RegExp/prototype/dotAll/name.js @@ -13,13 +13,15 @@ includes: [propertyHelper.js] features: [regexp-dotall] ---*/ -var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll'); +var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll"); assert.sameValue( - descriptor.get.name, - 'get dotAll' + desc.get.name, + "get dotAll" ); -verifyNotEnumerable(descriptor.get, 'name'); -verifyNotWritable(descriptor.get, 'name'); -verifyConfigurable(descriptor.get, 'name'); +verifyProperty(desc.get, "name", { + enumerable: false, + writable: false, + configurable: true, +}); diff --git a/test/built-ins/RegExp/prototype/dotAll/prop-desc.js b/test/built-ins/RegExp/prototype/dotAll/prop-desc.js index 2e1833d218..7a0351dd2e 100644 --- a/test/built-ins/RegExp/prototype/dotAll/prop-desc.js +++ b/test/built-ins/RegExp/prototype/dotAll/prop-desc.js @@ -3,14 +3,27 @@ /*--- esid: sec-get-regexp.prototype.dotall description: > - `pending` property descriptor -info: > - RegExp.prototype.dotAll is an accessor property whose set accessor - function is undefined. + `pending` property descriptor +info: | + RegExp.prototype.dotAll is an accessor property whose set accessor + 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] ---*/ -var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll'); +var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll"); 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, +}); diff --git a/test/built-ins/RegExp/prototype/dotAll/this-val-non-obj.js b/test/built-ins/RegExp/prototype/dotAll/this-val-non-obj.js index 9525baa6fa..865ad65c37 100644 --- a/test/built-ins/RegExp/prototype/dotAll/this-val-non-obj.js +++ b/test/built-ins/RegExp/prototype/dotAll/this-val-non-obj.js @@ -13,28 +13,28 @@ info: > features: [Symbol, regexp-dotall] ---*/ -var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, 'dotAll').get; +var dotAll = Object.getOwnPropertyDescriptor(RegExp.prototype, "dotAll").get; assert.throws(TypeError, function() { dotAll.call(undefined); -}); +}, "undefined"); assert.throws(TypeError, function() { dotAll.call(null); -}); +}, "null"); assert.throws(TypeError, function() { dotAll.call(true); -}); +}, "true"); assert.throws(TypeError, function() { - dotAll.call('string'); -}); + dotAll.call("string"); +}, "string"); assert.throws(TypeError, function() { - dotAll.call(Symbol('s')); -}); + dotAll.call(Symbol("s")); +}, "symbol"); assert.throws(TypeError, function() { dotAll.call(4); -}); +}, "number"); diff --git a/test/built-ins/RegExp/prototype/dotAll/this-val-regexp-prototype.js b/test/built-ins/RegExp/prototype/dotAll/this-val-regexp-prototype.js index d8d12b52e5..96d80ac1cf 100644 --- a/test/built-ins/RegExp/prototype/dotAll/this-val-regexp-prototype.js +++ b/test/built-ins/RegExp/prototype/dotAll/this-val-regexp-prototype.js @@ -14,6 +14,6 @@ info: | 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); diff --git a/test/built-ins/RegExp/prototype/dotAll/this-val-regexp.js b/test/built-ins/RegExp/prototype/dotAll/this-val-regexp.js index 7ed60af6cb..5b164c1fe9 100644 --- a/test/built-ins/RegExp/prototype/dotAll/this-val-regexp.js +++ b/test/built-ins/RegExp/prototype/dotAll/this-val-regexp.js @@ -14,26 +14,26 @@ info: > features: [regexp-dotall] ---*/ -assert.sameValue(/./.dotAll, false); -assert.sameValue(/./i.dotAll, false); -assert.sameValue(/./g.dotAll, false); -assert.sameValue(/./y.dotAll, false); -assert.sameValue(/./m.dotAll, false); +assert.sameValue(/./.dotAll, false, "/./.dotAll"); +assert.sameValue(/./i.dotAll, false, "/./i.dotAll"); +assert.sameValue(/./g.dotAll, false, "/./g.dotAll"); +assert.sameValue(/./y.dotAll, false, "/./y.dotAll"); +assert.sameValue(/./m.dotAll, false, "/./m.dotAll"); -assert.sameValue(/./s.dotAll, true); -assert.sameValue(/./is.dotAll, true); -assert.sameValue(/./sg.dotAll, true); -assert.sameValue(/./is.dotAll, true); -assert.sameValue(/./ms.dotAll, true); +assert.sameValue(/./s.dotAll, true, "/./s.dotAll"); +assert.sameValue(/./is.dotAll, true, "/./is.dotAll"); +assert.sameValue(/./sg.dotAll, true, "/./sg.dotAll"); +assert.sameValue(/./is.dotAll, true, "/./is.dotAll"); +assert.sameValue(/./ms.dotAll, true, "/./ms.dotAll"); -assert.sameValue(new RegExp(".", "").dotAll, false); -assert.sameValue(new RegExp(".", "i").dotAll, false); -assert.sameValue(new RegExp(".", "g").dotAll, false); -assert.sameValue(new RegExp(".", "y").dotAll, false); -assert.sameValue(new RegExp(".", "m").dotAll, false); +assert.sameValue(new RegExp(".", "").dotAll, false, "new RegExp('.', '').dotAll"); +assert.sameValue(new RegExp(".", "i").dotAll, false, "new RegExp('.', 'i').dotAll"); +assert.sameValue(new RegExp(".", "g").dotAll, false, "new RegExp('.', 'g').dotAll"); +assert.sameValue(new RegExp(".", "y").dotAll, false, "new RegExp('.', 'y').dotAll"); +assert.sameValue(new RegExp(".", "m").dotAll, false, "new RegExp('.', 'm').dotAll"); -assert.sameValue(new RegExp(".", "s").dotAll, true); -assert.sameValue(new RegExp(".", "is").dotAll, true); -assert.sameValue(new RegExp(".", "sg").dotAll, true); -assert.sameValue(new RegExp(".", "is").dotAll, true); -assert.sameValue(new RegExp(".", "ms").dotAll, true); +assert.sameValue(new RegExp(".", "s").dotAll, true, "new RegExp('.', 's').dotAll"); +assert.sameValue(new RegExp(".", "is").dotAll, true, "new RegExp('.', 'is').dotAll"); +assert.sameValue(new RegExp(".", "sg").dotAll, true, "new RegExp('.', 'sg').dotAll"); +assert.sameValue(new RegExp(".", "is").dotAll, true, "new RegExp('.', 'is').dotAll"); +assert.sameValue(new RegExp(".", "ms").dotAll, true, "new RegExp('.', 'ms').dotAll");