mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Add test for inequality of RegExps created from the same source (#776)
This commit is contained in:
parent
638c4801e6
commit
b4c633fc4f
19
test/language/literals/regexp/inequality.js
Normal file
19
test/language/literals/regexp/inequality.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (C) 2016 Kevin Gibbons. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Regular expression literals should not compare as equal even if they appear in the same source position.
|
||||||
|
esid: sec-regular-expression-literals-runtime-semantics-evaluation
|
||||||
|
---*/
|
||||||
|
|
||||||
|
function makeRegExp() {
|
||||||
|
return /(?:)/;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.notSameValue(makeRegExp(), makeRegExp());
|
||||||
|
|
||||||
|
var values = [];
|
||||||
|
for (var i = 0; i < 2; ++i) {
|
||||||
|
values[i] = /(?:)/;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert.notSameValue(values[0], values[1]);
|
Loading…
x
Reference in New Issue
Block a user