mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
[v8-test262-automation] Changes from https://github.com/v8/v8.git at sha 3a8c8082 on Fri Nov 16 2018 19:00:23 GMT+0000 (Coordinated Universal Time)
This commit is contained in:
parent
2726142bb9
commit
bb9647dd4b
32
implementation-contributed/v8/intl/regress-903566.js
Normal file
32
implementation-contributed/v8/intl/regress-903566.js
Normal file
@ -0,0 +1,32 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
assertDoesNotThrow(()=>(new Intl.ListFormat()).format());
|
||||
// Intl.getCanonicalLocales() will create a HOLEY_ELEMENTS array
|
||||
assertDoesNotThrow(()=>(new Intl.ListFormat()).format(Intl.getCanonicalLocales()));
|
||||
assertDoesNotThrow(()=>(new Intl.ListFormat()).format(Intl.getCanonicalLocales(["en","fr"])));
|
||||
|
||||
let arr = ["a","b","c"];
|
||||
|
||||
// Test under no HasHoleyElements();
|
||||
assertFalse(%HasHoleyElements(arr));
|
||||
assertDoesNotThrow(()=>(new Intl.ListFormat()).format(arr));
|
||||
for (var i = 0; i < 10000; i++) {
|
||||
arr.push("xx");
|
||||
}
|
||||
assertFalse(%HasHoleyElements(arr));
|
||||
assertDoesNotThrow(()=>(new Intl.ListFormat()).format(arr));
|
||||
|
||||
// Test under HasHoleyElements();
|
||||
arr[arr.length + 10] = "x";
|
||||
assertTrue(%HasHoleyElements(arr));
|
||||
assertFalse(%HasDictionaryElements(arr));
|
||||
assertThrows(()=>(new Intl.ListFormat()).format(arr), TypeError);
|
||||
|
||||
// Test it work under HasDictionaryElements();
|
||||
arr = ["a","b","c"];
|
||||
arr[arr.length + 100000] = "x";
|
||||
assertTrue(%HasDictionaryElements(arr));
|
||||
assertThrows(()=>(new Intl.ListFormat()).format(arr), TypeError);
|
@ -0,0 +1,106 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
(function NonConstHasInstance() {
|
||||
var C = {
|
||||
[Symbol.hasInstance] : () => true
|
||||
};
|
||||
|
||||
function f() {
|
||||
return {} instanceof C;
|
||||
}
|
||||
|
||||
assertTrue(f());
|
||||
assertTrue(f());
|
||||
%OptimizeFunctionOnNextCall(f);
|
||||
assertTrue(f());
|
||||
C[Symbol.hasInstance] = () => false;
|
||||
assertFalse(f());
|
||||
})();
|
||||
|
||||
(function NumberHasInstance() {
|
||||
var C = {
|
||||
[Symbol.hasInstance] : 0.1
|
||||
};
|
||||
|
||||
function f(b, C) {
|
||||
if (b) return {} instanceof C;
|
||||
return false;
|
||||
}
|
||||
|
||||
function g(b) {
|
||||
return f(b, C);
|
||||
}
|
||||
|
||||
assertFalse(f(true, Number));
|
||||
assertFalse(f(true, Number));
|
||||
assertFalse(g(false));
|
||||
assertFalse(g(false));
|
||||
%OptimizeFunctionOnNextCall(g);
|
||||
assertThrows(() => g(true));
|
||||
})();
|
||||
|
||||
(function NonFunctionHasInstance() {
|
||||
var C = {
|
||||
[Symbol.hasInstance] : {}
|
||||
};
|
||||
|
||||
function f(b, C) {
|
||||
if (b) return {} instanceof C;
|
||||
return false;
|
||||
}
|
||||
|
||||
function g(b) {
|
||||
return f(b, C);
|
||||
}
|
||||
|
||||
assertFalse(f(true, Number));
|
||||
assertFalse(f(true, Number));
|
||||
assertFalse(g(false));
|
||||
assertFalse(g(false));
|
||||
%OptimizeFunctionOnNextCall(g);
|
||||
assertThrows(() => g(true));
|
||||
})();
|
||||
|
||||
(function NonConstHasInstanceProto() {
|
||||
var B = {
|
||||
[Symbol.hasInstance]() { return true; }
|
||||
};
|
||||
|
||||
var C = { __proto__ : B };
|
||||
|
||||
function f() {
|
||||
return {} instanceof C;
|
||||
}
|
||||
|
||||
assertTrue(f());
|
||||
assertTrue(f());
|
||||
%OptimizeFunctionOnNextCall(f);
|
||||
assertTrue(f());
|
||||
B[Symbol.hasInstance] = () => { return false; };
|
||||
assertFalse(f());
|
||||
})();
|
||||
|
||||
(function HasInstanceOverwriteOnProto() {
|
||||
var A = {
|
||||
[Symbol.hasInstance] : () => false
|
||||
}
|
||||
|
||||
var B = { __proto__ : A };
|
||||
|
||||
var C = { __proto__ : B };
|
||||
|
||||
function f() {
|
||||
return {} instanceof C;
|
||||
}
|
||||
|
||||
assertFalse(f());
|
||||
assertFalse(f());
|
||||
%OptimizeFunctionOnNextCall(f);
|
||||
assertFalse(f());
|
||||
B[Symbol.hasInstance] = () => { return true; };
|
||||
assertTrue(f());
|
||||
})();
|
@ -0,0 +1,8 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Create BigInt in large object space for which MakeImmutable reduces the
|
||||
// length.
|
||||
const x = 2n ** (2n ** 22n);
|
||||
assertEquals(1n, x - (x - 1n));
|
@ -0,0 +1,5 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
assertThrows("function test() { '\\u`''\\u' }", SyntaxError)
|
@ -0,0 +1,10 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
var g = function f(a = 3) {
|
||||
var context_allocated = undefined;
|
||||
function inner() { f(); f(context_allocated) };
|
||||
inner();
|
||||
};
|
||||
assertThrows("g()", RangeError);
|
@ -0,0 +1,49 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
(function() {
|
||||
function foo(x) {
|
||||
return Math.abs(Math.min(+x, 0));
|
||||
}
|
||||
|
||||
assertEquals(NaN, foo());
|
||||
assertEquals(NaN, foo());
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(NaN, foo());
|
||||
})();
|
||||
|
||||
(function() {
|
||||
function foo(x) {
|
||||
return Math.abs(Math.min(-x, 0));
|
||||
}
|
||||
|
||||
assertEquals(NaN, foo());
|
||||
assertEquals(NaN, foo());
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(NaN, foo());
|
||||
})();
|
||||
|
||||
(function() {
|
||||
function foo(x) {
|
||||
return Math.abs(Math.max(0, +x));
|
||||
}
|
||||
|
||||
assertEquals(NaN, foo());
|
||||
assertEquals(NaN, foo());
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(NaN, foo());
|
||||
})();
|
||||
|
||||
(function() {
|
||||
function foo(x) {
|
||||
return Math.abs(Math.max(0, -x));
|
||||
}
|
||||
|
||||
assertEquals(NaN, foo());
|
||||
assertEquals(NaN, foo());
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(NaN, foo());
|
||||
})();
|
@ -0,0 +1,16 @@
|
||||
// Copyright 2018 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
load('test/mjsunit/wasm/wasm-constants.js');
|
||||
load('test/mjsunit/wasm/wasm-module-builder.js');
|
||||
|
||||
const builder = new WasmModuleBuilder();
|
||||
const sig = makeSig([kWasmI32, kWasmI64, kWasmI64], [kWasmI64]);
|
||||
builder.addFunction(undefined, sig)
|
||||
.addBody([
|
||||
kExprGetLocal, 2,
|
||||
kExprGetLocal, 1,
|
||||
kExprI64Shl,
|
||||
]);
|
||||
builder.instantiate();
|
@ -328,6 +328,62 @@
|
||||
'language/literals/regexp/invalid-optional-negative-lookbehind': [FAIL],
|
||||
'language/literals/regexp/invalid-range-lookbehind': [FAIL],
|
||||
'language/literals/regexp/invalid-range-negative-lookbehind': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-2': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-2-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-3': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-3-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-4': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-4-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-5': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-duplicate-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-empty-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-empty-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-2': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-3': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-4': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-5': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-6': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-numeric-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-unterminated-groupspecifier': [FAIL],
|
||||
'language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u': [FAIL],
|
||||
'language/literals/regexp/u-dec-esc': [FAIL],
|
||||
'language/literals/regexp/u-invalid-class-escape': [FAIL],
|
||||
'language/literals/regexp/u-invalid-extended-pattern-char': [FAIL],
|
||||
|
Loading…
x
Reference in New Issue
Block a user