From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../RegExp/prototype/ignoreCase/15.10.7.3-2.js | 19 ++++++++++ .../RegExp/prototype/ignoreCase/S15.10.7.3_A10.js | 26 +++++++++++++ .../RegExp/prototype/ignoreCase/S15.10.7.3_A8.js | 33 +++++++++++++++++ .../RegExp/prototype/ignoreCase/S15.10.7.3_A9.js | 20 ++++++++++ .../RegExp/prototype/ignoreCase/browser.js | 0 .../RegExp/prototype/ignoreCase/cross-realm.js | 28 ++++++++++++++ .../RegExp/prototype/ignoreCase/length.js | 33 +++++++++++++++++ .../built-ins/RegExp/prototype/ignoreCase/name.js | 26 +++++++++++++ .../built-ins/RegExp/prototype/ignoreCase/shell.js | 0 .../prototype/ignoreCase/this-val-invalid-obj.js | 32 ++++++++++++++++ .../prototype/ignoreCase/this-val-non-obj.js | 43 ++++++++++++++++++++++ .../ignoreCase/this-val-regexp-prototype.js | 19 ++++++++++ 12 files changed, 279 insertions(+) create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A8.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A9.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/browser.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/cross-realm.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/shell.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-invalid-obj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-non-obj.js create mode 100644 js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-regexp-prototype.js (limited to 'js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase') diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js new file mode 100644 index 0000000000..125ec41eb4 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/15.10.7.3-2.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: 15.10.7.3-2 +description: > + RegExp.prototype.ignoreCase is an accessor property whose set + accessor function is undefined +---*/ + + var d = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase'); + + +assert.sameValue(typeof d.get, 'function', 'typeof d.get'); +assert.sameValue(d.set, undefined, 'd.set'); +assert.sameValue(d.enumerable, false, 'd.enumerable'); +assert.sameValue(d.configurable, true, 'd.configurable'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js new file mode 100644 index 0000000000..17c3ecb5bb --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A10.js @@ -0,0 +1,26 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The RegExp.prototype ignoreCase property does not have a set accessor +es5id: 15.10.7.3_A10 +description: Checking if varying the ignoreCase property fails +includes: [propertyHelper.js] +---*/ + +var __re = RegExp.prototype; + +assert.sameValue(__re.hasOwnProperty('ignoreCase'), true, '__re.hasOwnProperty(\'ignoreCase\') must return true'); + +var __sample = /a|b|c/; +var __obj = __sample.ignoreCase; + +verifyNotWritable(__sample, "ignoreCase", "ignoreCase", "shifted"); + +assert.sameValue( + __sample.ignoreCase, + __obj, + 'The value of __sample.ignoreCase is expected to equal the value of __obj' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A8.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A8.js new file mode 100644 index 0000000000..a70df8a51e --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A8.js @@ -0,0 +1,33 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The RegExp.prototype ignoreCase property has the attribute DontEnum +es5id: 15.10.7.3_A8 +description: > + Checking if enumerating the ignoreCase property of + RegExp.prototype fails +---*/ + +var __re = RegExp.prototype; + +assert.sameValue(__re.hasOwnProperty('ignoreCase'), true, '__re.hasOwnProperty(\'ignoreCase\') must return true'); + +assert.sameValue( + __re.propertyIsEnumerable('ignoreCase'), + false, + '__re.propertyIsEnumerable(\'ignoreCase\') must return false' +); + +var count = 0 +for (var p in __re){ + if (p==="ignoreCase") { + count++ + } +} + +assert.sameValue(count, 0, 'The value of count is expected to be 0'); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A9.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A9.js new file mode 100644 index 0000000000..70edcce662 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/S15.10.7.3_A9.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The RegExp.prototype ignoreCase property does not have the attribute + DontDelete +es5id: 15.10.7.3_A9 +description: Checking if deleting the ignoreCase property succeeds +---*/ + +var __re = RegExp.prototype; + +assert.sameValue(__re.hasOwnProperty('ignoreCase'), true, '__re.hasOwnProperty(\'ignoreCase\') must return true'); +assert.sameValue(delete __re.ignoreCase, true, 'The value of `delete __re.ignoreCase` is expected to be true'); +assert.sameValue(__re.hasOwnProperty('ignoreCase'), false, '__re.hasOwnProperty(\'ignoreCase\') must return false'); + +// TODO: Convert to verifyProperty() format. + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/browser.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/cross-realm.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/cross-realm.js new file mode 100644 index 0000000000..8a56805273 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/cross-realm.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-regexp.prototype.ignorecase +description: A TypeError is thrown when the "this" value is an invalid cross-realm Object +info: | + 1. Let R be the this value. + 2. If Type(R) is not Object, throw a TypeError exception. + 3. If R does not have an [[OriginalFlags]] internal slot, then + a. If SameValue(R, %RegExpPrototype%) is true, return undefined. + b. Otherwise, throw a TypeError exception. +features: [cross-realm] +---*/ + +var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get; +var other = $262.createRealm().global; +var otherRegExpProto = other.RegExp.prototype; +var otherRegExpGetter = Object.getOwnPropertyDescriptor(otherRegExpProto, 'ignoreCase').get; + +assert.throws(TypeError, function() { + get.call(otherRegExpProto); +}, 'cross-realm RegExp.prototype'); + +assert.throws(other.TypeError, function() { + otherRegExpGetter.call(RegExp.prototype); +}, 'cross-realm RegExp.prototype getter method against primary realm RegExp.prototype'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js new file mode 100644 index 0000000000..3707ec5ad1 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/length.js @@ -0,0 +1,33 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: 21.2.5.5 +description: > + get RegExp.prototype.ignoreCase.length is 0. +info: | + get RegExp.prototype.ignoreCase + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, "ignoreCase"); + +assert.sameValue(desc.get.length, 0); + +verifyNotEnumerable(desc.get, "length"); +verifyNotWritable(desc.get, "length"); +verifyConfigurable(desc.get, "length"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js new file mode 100644 index 0000000000..1f3894cbbe --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/name.js @@ -0,0 +1,26 @@ +// Copyright (C) 2015 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 21.2.5.5 +description: > + RegExp.prototype.ignoreCase name +info: | + 17 ECMAScript Standard Built-in Objects + + Functions that are specified as get or set accessor functions of built-in + properties have "get " or "set " prepended to the property name string. +includes: [propertyHelper.js] +---*/ + +var descriptor = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase'); + +assert.sameValue( + descriptor.get.name, + 'get ignoreCase' +); + +verifyNotEnumerable(descriptor.get, 'name'); +verifyNotWritable(descriptor.get, 'name'); +verifyConfigurable(descriptor.get, 'name'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/shell.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-invalid-obj.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-invalid-obj.js new file mode 100644 index 0000000000..4ffb9390e5 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-invalid-obj.js @@ -0,0 +1,32 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-regexp.prototype.ignorecase +description: A TypeError is thrown when the "this" value is an invalid Object +info: | + 1. Let R be the this value. + 2. If Type(R) is not Object, throw a TypeError exception. + 3. If R does not have an [[OriginalFlags]] internal slot, then + a. If SameValue(R, %RegExpPrototype%) is true, return undefined. + b. Otherwise, throw a TypeError exception. +---*/ + +var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get; + +assert.throws(TypeError, function() { + get.call({}); +}, 'ordinary object'); + +assert.throws(TypeError, function() { + get.call([]); +}, 'array exotic object'); + +assert.throws(TypeError, function() { + get.call(arguments); +}, 'arguments object'); + +assert.throws(TypeError, function() { + get.call(() => {}); +}, 'function object'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-non-obj.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-non-obj.js new file mode 100644 index 0000000000..00ac21cc25 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-non-obj.js @@ -0,0 +1,43 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-regexp.prototype.ignorecase +description: A TypeError is thrown when the "this" value is not an Object +info: | + 1. Let R be the this value. + 2. If Type(R) is not Object, throw a TypeError exception. +features: [Symbol] +---*/ + +var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get; +var symbol = Symbol(); + +assert.throws(TypeError, function() { + get.call(undefined); +}, 'undefined'); + +assert.throws(TypeError, function() { + get.call(null); +}, 'null'); + +assert.throws(TypeError, function() { + get.call(3); +}, 'number'); + +assert.throws(TypeError, function() { + get.call('string'); +}, 'string'); + +assert.throws(TypeError, function() { + get.call(true); +}, 'boolean'); + +assert.throws(TypeError, function() { + get.call(symbol); +}, 'symbol'); + +assert.throws(TypeError, function() { + get.call(4n); +}, 'bigint'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-regexp-prototype.js b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-regexp-prototype.js new file mode 100644 index 0000000000..51157d86b0 --- /dev/null +++ b/js/src/tests/test262/built-ins/RegExp/prototype/ignoreCase/this-val-regexp-prototype.js @@ -0,0 +1,19 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-get-regexp.prototype.ignorecase +description: > + Return value of `undefined` when the "this" value is the RegExp prototype + object +info: | + 1. Let R be the this value. + 2. If Type(R) is not Object, throw a TypeError exception. + 3. If R does not have an [[OriginalFlags]] internal slot, then + a. If SameValue(R, %RegExpPrototype%) is true, return undefined. +---*/ + +var get = Object.getOwnPropertyDescriptor(RegExp.prototype, 'ignoreCase').get; + +assert.sameValue(get.call(RegExp.prototype), undefined); + +reportCompare(0, 0); -- cgit v1.2.3