Merge pull request #1918 from test262-automation/v8-test262-automation-export-d38e98d1f3

Import test changes from V8
This commit is contained in:
Leo Balter 2018-11-05 10:10:53 -05:00 committed by GitHub
commit d8b0dd4275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 1459 additions and 5 deletions

View File

@ -1,5 +1,5 @@
{
"sourceRevisionAtLastExport": "27dc9fa5",
"targetRevisionAtLastExport": "d38e98d1f3",
"sourceRevisionAtLastExport": "f5cf90cc",
"targetRevisionAtLastExport": "edab36a568",
"curatedFiles": {}
}

View File

@ -53,10 +53,24 @@ for (var prop in options) {
}
}
// In the order of Table 6 of
// ecma402 #sec-intl.datetimeformat.prototype.resolvedoptions
var expectedProperties = [
'calendar', 'day', 'era', 'hour12', 'hour', 'locale',
'minute', 'month', 'numberingSystem',
'second', 'timeZone', 'timeZoneName', 'weekday', 'year'
'locale',
'calendar',
'numberingSystem',
'timeZone',
'hourCycle',
'hour12',
'weekday',
'era',
'year',
'month',
'day',
'hour',
'minute',
'second',
'timeZoneName',
];
assertEquals(expectedProperties.length, properties.length);

View File

@ -66,3 +66,44 @@ assertEquals('day', parts[0].unit);
assertEquals(2, Object.getOwnPropertyNames(parts[1]).length);
assertEquals('literal', parts[1].type);
assertEquals(' days ago', parts[1].value);
// Test with non integer
// Part Idx: 0 1 23 45 6
assertEquals('in 123,456.78 seconds', longAlways.format(123456.78, 'seconds'));
parts = longAlways.formatToParts(123456.78, 'seconds');
assertEquals(7, parts.length);
// 0: "in "
assertEquals(2, Object.getOwnPropertyNames(parts[0]).length);
assertEquals('literal', parts[0].type);
assertEquals('in ', parts[0].value);
assertEquals(undefined, parts[0].unit);
// 1: "123"
assertEquals(3, Object.getOwnPropertyNames(parts[1]).length);
assertEquals('integer', parts[1].type);
assertEquals('123', parts[1].value);
assertEquals('second', parts[1].unit);
// 2: ","
assertEquals(3, Object.getOwnPropertyNames(parts[2]).length);
assertEquals('group', parts[2].type);
assertEquals(',', parts[2].value);
assertEquals('second', parts[2].unit);
// 3: "456"
assertEquals(3, Object.getOwnPropertyNames(parts[3]).length);
assertEquals('integer', parts[3].type);
assertEquals('456', parts[3].value);
assertEquals('second', parts[3].unit);
// 4: "."
assertEquals(3, Object.getOwnPropertyNames(parts[4]).length);
assertEquals('decimal', parts[4].type);
assertEquals('.', parts[4].value);
assertEquals('second', parts[4].unit);
// 5: "78"
assertEquals(3, Object.getOwnPropertyNames(parts[4]).length);
assertEquals('fraction', parts[5].type);
assertEquals('78', parts[5].value);
assertEquals('second', parts[5].unit);
// 6: " seconds"
assertEquals(2, Object.getOwnPropertyNames(parts[6]).length);
assertEquals('literal', parts[6].type);
assertEquals(' seconds', parts[6].value);
assertEquals(undefined, parts[6].unit);

View File

@ -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("/*for..in*/for(var [x5, functional] = this = function(id) { return id } in false) var x2, x;", ReferenceError);

View File

@ -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 g(){}function g(){+", SyntaxError);

View File

@ -0,0 +1,11 @@
// 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
var a = [0, 1];
var o = { [Symbol.toPrimitive]() { a.length = 1; return 2; } };
a.push(2);
a.lastIndexOf(5, o);

View File

@ -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.
function f() {
'use strict'
in Number
}
f.arguments

File diff suppressed because it is too large Load Diff