Skip to content
Snippets Groups Projects
Commit e1cd1e7f authored by Mike Pennisi's avatar Mike Pennisi
Browse files

Update and tests for %RegExpPrototype% methods

A recent web-compatability change to ECMA262 modified the semantics of
the accessor methods on the %RegExpPrototype% intrinsic--the "get"
accessors now include steps dedicated to the case where the "this" value
is the %RegExpPrototype% object itself.

Remove the tests that have been invalidated by this change, introduce
tests asserting the new behavior, and extend coverage for other possible
"this" values.
parent 9114f815
No related branches found
No related tags found
No related merge requests found
...@@ -17,4 +17,12 @@ var unicode = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get; ...@@ -17,4 +17,12 @@ var unicode = Object.getOwnPropertyDescriptor(RegExp.prototype, 'unicode').get;
assert.throws(TypeError, function() { assert.throws(TypeError, function() {
unicode.call({}); unicode.call({});
}); }, 'ordinary object');
assert.throws(TypeError, function() {
unicode.call([]);
}, 'array exotic object');
assert.throws(TypeError, function() {
unicode.call(arguments);
}, 'arguments object');
// 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.unicode
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, 'unicode').get;
assert.sameValue(get.call(RegExp.prototype), undefined);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment