mirror of https://github.com/tc39/test262.git
[v8-test262-automation] Changes from https://github.com/v8/v8.git at sha c9524b41 on Tue Oct 09 2018 18:40:34 GMT+0000 (Coordinated Universal Time)
This commit is contained in:
parent
36772d4e6b
commit
234933fe8a
|
@ -27,55 +27,67 @@
|
||||||
|
|
||||||
// Tests supportedLocalesOf method.
|
// Tests supportedLocalesOf method.
|
||||||
|
|
||||||
var undef = Intl.DateTimeFormat.supportedLocalesOf();
|
var services = [
|
||||||
assertEquals([], undef);
|
Intl.DateTimeFormat,
|
||||||
|
Intl.Collator,
|
||||||
|
Intl.NumberFormat,
|
||||||
|
Intl.PluralRules
|
||||||
|
];
|
||||||
|
|
||||||
var empty = Intl.DateTimeFormat.supportedLocalesOf([]);
|
for (const service of services) {
|
||||||
assertEquals([], empty);
|
let undef = service.supportedLocalesOf();
|
||||||
|
assertEquals([], undef);
|
||||||
|
|
||||||
var strLocale = Intl.DateTimeFormat.supportedLocalesOf('sr');
|
let empty = service.supportedLocalesOf([]);
|
||||||
assertEquals('sr', strLocale[0]);
|
assertEquals([], empty);
|
||||||
|
|
||||||
var multiLocale =
|
let strLocale = service.supportedLocalesOf("sr");
|
||||||
Intl.DateTimeFormat.supportedLocalesOf(['sr-Thai-RS', 'de', 'zh-CN']);
|
assertEquals("sr", strLocale[0]);
|
||||||
assertEquals('sr-Thai-RS', multiLocale[0]);
|
|
||||||
assertEquals('de', multiLocale[1]);
|
|
||||||
assertEquals('zh-CN', multiLocale[2]);
|
|
||||||
|
|
||||||
collatorUndef = Intl.Collator.supportedLocalesOf();
|
var locales = ["sr-Thai-RS", "de", "zh-CN"];
|
||||||
assertEquals([], collatorUndef);
|
let multiLocale = service.supportedLocalesOf(locales);
|
||||||
|
assertEquals("sr-Thai-RS", multiLocale[0]);
|
||||||
|
assertEquals("de", multiLocale[1]);
|
||||||
|
assertEquals("zh-CN", multiLocale[2]);
|
||||||
|
|
||||||
collatorEmpty = Intl.Collator.supportedLocalesOf([]);
|
let numLocale = service.supportedLocalesOf(1);
|
||||||
assertEquals([], collatorEmpty);
|
assertEquals([], numLocale);
|
||||||
|
assertThrows(function() {
|
||||||
|
numLocale = Intl.Collator.supportedLocalesOf([1]);
|
||||||
|
}, TypeError);
|
||||||
|
|
||||||
collatorStrLocale = Intl.Collator.supportedLocalesOf('sr');
|
extensionLocale = service.supportedLocalesOf("id-u-co-pinyin");
|
||||||
assertEquals('sr', collatorStrLocale[0]);
|
assertEquals("id-u-co-pinyin", extensionLocale[0]);
|
||||||
|
|
||||||
collatorMultiLocale =
|
bestFitLocale = service.supportedLocalesOf("de", {
|
||||||
Intl.Collator.supportedLocalesOf(['sr-Thai-RS', 'de', 'zh-CN']);
|
localeMatcher: "best fit"
|
||||||
assertEquals('sr-Thai-RS', collatorMultiLocale[0]);
|
});
|
||||||
assertEquals('de', collatorMultiLocale[1]);
|
assertEquals("de", bestFitLocale[0]);
|
||||||
assertEquals('zh-CN', collatorMultiLocale[2]);
|
|
||||||
|
|
||||||
numLocale = Intl.Collator.supportedLocalesOf(1);
|
// Need a better test for "lookup" once it differs from "best fit".
|
||||||
assertEquals([], numLocale);
|
lookupLocale = service.supportedLocalesOf("zh-CN", {
|
||||||
|
localeMatcher: "lookup"
|
||||||
|
});
|
||||||
|
assertEquals("zh-CN", lookupLocale[0]);
|
||||||
|
|
||||||
assertThrows(function() {
|
assertThrows(function() {
|
||||||
numLocale = Intl.Collator.supportedLocalesOf([1]);
|
service.supportedLocalesOf("id-u-co-pinyin", { localeMatcher: "xyz" });
|
||||||
}, TypeError);
|
}, RangeError);
|
||||||
|
|
||||||
extensionLocale = Intl.Collator.supportedLocalesOf('id-u-co-pinyin');
|
privateuseLocale = service.supportedLocalesOf("en-US-x-twain");
|
||||||
assertEquals('id-u-co-pinyin', extensionLocale[0]);
|
assertEquals("en-US-x-twain", privateuseLocale[0]);
|
||||||
|
|
||||||
bestFitLocale =
|
privateuseLocale2 = service.supportedLocalesOf("x-twain");
|
||||||
Intl.Collator.supportedLocalesOf('de', {localeMatcher: 'best fit'});
|
assertEquals(undefined, privateuseLocale2[0]);
|
||||||
assertEquals('de', bestFitLocale[0]);
|
|
||||||
|
|
||||||
// Need a better test for "lookup" once it differs from "best fit".
|
grandfatheredLocale = service.supportedLocalesOf("art-lojban");
|
||||||
lookupLocale =
|
assertEquals(undefined, grandfatheredLocale[0]);
|
||||||
Intl.Collator.supportedLocalesOf('zh-CN', {localeMatcher: 'lookup'});
|
|
||||||
assertEquals('zh-CN', lookupLocale[0]);
|
|
||||||
|
|
||||||
assertThrows(function() {
|
grandfatheredLocale2 = service.supportedLocalesOf("i-pwn");
|
||||||
Intl.Collator.supportedLocalesOf('id-u-co-pinyin', {localeMatcher: 'xyz'});
|
assertEquals(undefined, grandfatheredLocale2[0]);
|
||||||
}, RangeError);
|
|
||||||
|
unicodeInPrivateuseLocale = service.supportedLocalesOf(
|
||||||
|
"en-US-x-u-co-phonebk"
|
||||||
|
);
|
||||||
|
assertEquals("en-US-x-u-co-phonebk", unicodeInPrivateuseLocale[0]);
|
||||||
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
# TODO(jochen): The following test is flaky.
|
# TODO(jochen): The following test is flaky.
|
||||||
'overrides/caching': [PASS, FAIL],
|
'overrides/caching': [PASS, FAIL],
|
||||||
|
|
||||||
'date-format/constructor-order': [FAIL],
|
|
||||||
|
|
||||||
# https://bugs.chromium.org/p/v8/issues/detail?id=6891
|
# https://bugs.chromium.org/p/v8/issues/detail?id=6891
|
||||||
'segmenter/segment': [FAIL],
|
'segmenter/segment': [FAIL],
|
||||||
'segmenter/segment-iterator': [FAIL],
|
'segmenter/segment-iterator': [FAIL],
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
// 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: --harmony-weak-refs
|
||||||
|
|
||||||
|
(function TestConstructWeakFactory() {
|
||||||
|
let wf = new WeakFactory();
|
||||||
|
assertEquals(wf.toString(), "[object WeakFactory]");
|
||||||
|
assertNotSame(wf.__proto__, Object.prototype);
|
||||||
|
assertSame(wf.__proto__.__proto__, Object.prototype);
|
||||||
|
})();
|
||||||
|
|
||||||
|
(function TestWeakFactoryConstructorCallAsFunction() {
|
||||||
|
let caught = false;
|
||||||
|
let message = "";
|
||||||
|
try {
|
||||||
|
let f = WeakFactory();
|
||||||
|
} catch (e) {
|
||||||
|
message = e.message;
|
||||||
|
caught = true;
|
||||||
|
} finally {
|
||||||
|
assertTrue(caught);
|
||||||
|
assertEquals(message, "Constructor WeakFactory requires 'new'");
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
(function TestMakeCell() {
|
||||||
|
let wf = new WeakFactory();
|
||||||
|
let wc = wf.makeCell({});
|
||||||
|
assertEquals(wc.toString(), "[object WeakCell]");
|
||||||
|
assertNotSame(wc.__proto__, Object.prototype);
|
||||||
|
assertSame(wc.__proto__.__proto__, Object.prototype);
|
||||||
|
})();
|
||||||
|
|
||||||
|
(function TestMakeCellWithoutWeakFactory() {
|
||||||
|
assertThrows(() => WeakFactory.prototype.makeCell.call({}, {}), TypeError);
|
||||||
|
})();
|
|
@ -0,0 +1,45 @@
|
||||||
|
// 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: --harmony-weak-refs --expose-gc
|
||||||
|
|
||||||
|
let cleanup_called = false;
|
||||||
|
let cleanup = function(iter) {
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
let cells = [];
|
||||||
|
for (wc of iter) {
|
||||||
|
cells.push(wc);
|
||||||
|
}
|
||||||
|
assertEquals(cells.length, 2);
|
||||||
|
if (cells[0] == wc1) {
|
||||||
|
assertEquals(cells[1], wc2);
|
||||||
|
} else {
|
||||||
|
assertEquals(cells[0], wc2);
|
||||||
|
assertEquals(cells[1], wc1);
|
||||||
|
}
|
||||||
|
cleanup_called = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let wf = new WeakFactory(cleanup);
|
||||||
|
let o1 = {};
|
||||||
|
let o2 = {};
|
||||||
|
let wc1 = wf.makeCell(o1);
|
||||||
|
let wc2 = wf.makeCell(o2);
|
||||||
|
|
||||||
|
gc();
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
|
||||||
|
// Drop the last references to o1 and o2.
|
||||||
|
o1 = null;
|
||||||
|
o2 = null;
|
||||||
|
// GC will clear the WeakCells; the cleanup function will be called the next time
|
||||||
|
// we enter the event loop.
|
||||||
|
gc();
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
|
||||||
|
let timeout_func = function() {
|
||||||
|
assertTrue(cleanup_called);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(timeout_func, 0);
|
|
@ -0,0 +1,36 @@
|
||||||
|
// 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: --harmony-weak-refs --expose-gc
|
||||||
|
|
||||||
|
let cleanup_called = false;
|
||||||
|
let cleanup = function(iter) {
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
let result = iter.next();
|
||||||
|
assertEquals(result.value, wc);
|
||||||
|
assertFalse(result.done);
|
||||||
|
result = iter.next();
|
||||||
|
assertTrue(result.done);
|
||||||
|
cleanup_called = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let wf = new WeakFactory(cleanup);
|
||||||
|
let o = {};
|
||||||
|
let wc = wf.makeCell(o);
|
||||||
|
|
||||||
|
gc();
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
|
||||||
|
// Drop the last reference to o.
|
||||||
|
o = null;
|
||||||
|
// GC will clear the WeakCell; the cleanup function will be called the next time
|
||||||
|
// we enter the event loop.
|
||||||
|
gc();
|
||||||
|
assertFalse(cleanup_called);
|
||||||
|
|
||||||
|
let timeout_func = function() {
|
||||||
|
assertTrue(cleanup_called);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(timeout_func, 0);
|
|
@ -105,7 +105,8 @@
|
||||||
'migrations': [SKIP],
|
'migrations': [SKIP],
|
||||||
'array-functions-prototype-misc': [PASS, SLOW, ['mode == debug', SKIP]],
|
'array-functions-prototype-misc': [PASS, SLOW, ['mode == debug', SKIP]],
|
||||||
'compiler/regress-808472': [PASS, ['mode == debug', SKIP]],
|
'compiler/regress-808472': [PASS, ['mode == debug', SKIP]],
|
||||||
'es6/promise-all-overflow-*': [PASS, SLOW, ['mode == debug or arch != x64', SKIP]],
|
'es6/promise-all-overflow-1': [SKIP],
|
||||||
|
'es6/promise-all-overflow-2': [PASS, SLOW, ['mode == debug or arch != x64', SKIP]],
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# This test sets the umask on a per-process basis and hence cannot be
|
# This test sets the umask on a per-process basis and hence cannot be
|
||||||
|
|
|
@ -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("()=>{ (x,x)=>1 }", SyntaxError)
|
|
@ -569,9 +569,6 @@
|
||||||
# https://bugs.chromium.org/p/v8/issues/detail?id=8262
|
# https://bugs.chromium.org/p/v8/issues/detail?id=8262
|
||||||
'intl402/Locale/constructor-parse-twice': [FAIL],
|
'intl402/Locale/constructor-parse-twice': [FAIL],
|
||||||
|
|
||||||
# https://bugs.chromium.org/p/v8/issues/detail?id=8259
|
|
||||||
'intl402/Locale/subclassing': [SKIP],
|
|
||||||
|
|
||||||
# https://bugs.chromium.org/p/v8/issues/detail?id=8246
|
# https://bugs.chromium.org/p/v8/issues/detail?id=8246
|
||||||
'intl402/Locale/constructor-tag': [FAIL],
|
'intl402/Locale/constructor-tag': [FAIL],
|
||||||
|
|
||||||
|
@ -639,7 +636,6 @@
|
||||||
'built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll': [FAIL],
|
'built-ins/String/prototype/matchAll/regexp-prototype-has-no-matchAll': [FAIL],
|
||||||
|
|
||||||
# https://bugs.chromium.org/p/v8/issues/detail?id=8258
|
# https://bugs.chromium.org/p/v8/issues/detail?id=8258
|
||||||
'intl402/DateTimeFormat/constructor-options-throwing-getters': [FAIL],
|
|
||||||
'intl402/Locale/constructor-options-language-valid-undefined': [FAIL],
|
'intl402/Locale/constructor-options-language-valid-undefined': [FAIL],
|
||||||
'intl402/Locale/constructor-options-throwing-getters': [FAIL],
|
'intl402/Locale/constructor-options-throwing-getters': [FAIL],
|
||||||
'intl402/Locale/constructor-tag-tostring': [FAIL],
|
'intl402/Locale/constructor-tag-tostring': [FAIL],
|
||||||
|
|
Loading…
Reference in New Issue