Skip to content
Snippets Groups Projects
Commit 20426679 authored by André Bargull's avatar André Bargull Committed by Leo Balter
Browse files

Fix various test issues (#840)

test/annexB/built-ins/Date/prototype/setYear/time-clip.js
test/built-ins/Date/prototype/setFullYear/new-value-time-clip.js
test/built-ins/Date/prototype/setMonth/new-value-time-clip.js
- Don't try to test time-clip at the end points, because this is near
impossible to get right (needs to consider time zone offset, dst, local
mean time because of Africa/Monrovia, etc.).

test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js
test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js
- Wasn't update to expect RangeError

test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js
- Change ClassDeclaration -> ClassExpression to get completion value

test/built-ins/Function/prototype/toString/AsyncFunction.js
- Add missing \n in expected string
- Also fixed in gh-847

test/built-ins/global/global-object.js
- Add 'var' to make test pass in strict-mode

test/language/block-scope/syntax/redeclaration-in-block/attempt-to-redeclare-function-declaration-with-function-declaration.js
- This is allowed in sloppy mode when Annex B is implemented

test/language/expressions/async-generators/expression-yield-as-statement.js
- Fix calls to then()

test/language/module-code/namespace/internals/own-property-keys-binding-types.js
test/language/module-code/namespace/internals/own-property-keys-sort.js
- Tests weren't updated after removal of @@iterator from module
namespace objects

test/language/module-code/namespace/internals/set-prototype-of-null.js
- Fix syntax error

test/language/statements/async-function/early-errors-no-async-generator.js
- No longer valid now that async iteration proposal is at stage 3
parent 4203261b
No related branches found
No related tags found
No related merge requests found
Showing
with 15 additions and 28 deletions
...@@ -15,7 +15,7 @@ info: | ...@@ -15,7 +15,7 @@ info: |
var date; var date;
date = new Date(1970, 8, 12, 20, 0, 0, 0); date = new Date(1970, 8, 10, 0, 0, 0, 0);
assert.notSameValue( assert.notSameValue(
date.setYear(275760), NaN, 'method return value (valid date)' date.setYear(275760), NaN, 'method return value (valid date)'
...@@ -24,7 +24,7 @@ assert.notSameValue( ...@@ -24,7 +24,7 @@ assert.notSameValue(
date.valueOf(), NaN, '[[DateValue]] internal slot (valid date)' date.valueOf(), NaN, '[[DateValue]] internal slot (valid date)'
); );
date = new Date(1970, 8, 12, 20, 0, 0, 1); date = new Date(1970, 8, 14, 0, 0, 0, 0);
assert.sameValue( assert.sameValue(
date.setYear(275760), NaN, 'method return value (invalid date)' date.setYear(275760), NaN, 'method return value (invalid date)'
......
...@@ -28,7 +28,7 @@ var sample = new DataView(buffer, 0); ...@@ -28,7 +28,7 @@ var sample = new DataView(buffer, 0);
$DETACHBUFFER(buffer); $DETACHBUFFER(buffer);
assert.throws(TypeError, function() { assert.throws(RangeError, function() {
sample.setFloat64(Infinity, 0); sample.setFloat64(Infinity, 0);
}, "Infinity"); }, "Infinity");
......
...@@ -28,7 +28,7 @@ var sample = new DataView(buffer, 0); ...@@ -28,7 +28,7 @@ var sample = new DataView(buffer, 0);
$DETACHBUFFER(buffer); $DETACHBUFFER(buffer);
assert.throws(TypeError, function() { assert.throws(RangeError, function() {
sample.setInt16(Infinity, 0); sample.setInt16(Infinity, 0);
}, "Infinity"); }, "Infinity");
......
...@@ -44,6 +44,6 @@ assert.sameValue(returnValue, NaN, 'overflow due to month'); ...@@ -44,6 +44,6 @@ assert.sameValue(returnValue, NaN, 'overflow due to month');
date = new Date(maxMs); date = new Date(maxMs);
returnValue = date.setFullYear(maxYear, maxMonth, maxDate + 1); returnValue = date.setFullYear(maxYear, maxMonth, maxDate + 2);
assert.sameValue(returnValue, NaN, 'overflow due to date'); assert.sameValue(returnValue, NaN, 'overflow due to date');
...@@ -37,6 +37,6 @@ assert.sameValue(returnValue, NaN, 'overflow due to month'); ...@@ -37,6 +37,6 @@ assert.sameValue(returnValue, NaN, 'overflow due to month');
date = new Date(maxMs); date = new Date(maxMs);
returnValue = date.setMonth(maxMonth, maxDate + 1); returnValue = date.setMonth(maxMonth, maxDate + 2);
assert.sameValue(returnValue, NaN, 'overflow due to date'); assert.sameValue(returnValue, NaN, 'overflow due to date');
...@@ -19,9 +19,9 @@ features: [class] ...@@ -19,9 +19,9 @@ features: [class]
---*/ ---*/
var C = $.createRealm().global.eval( var C = $.createRealm().global.eval(
'class C extends Object {' + '(class C extends Object {' +
' constructor() {}' + ' constructor() {}' +
'}' '});'
); );
assert.throws(ReferenceError, function() { assert.throws(ReferenceError, function() {
......
...@@ -22,5 +22,5 @@ assert.sameValue(Number, global.Number); ...@@ -22,5 +22,5 @@ assert.sameValue(Number, global.Number);
assert.sameValue(RegExp, global.RegExp); assert.sameValue(RegExp, global.RegExp);
assert.sameValue(String, global.String); assert.sameValue(String, global.String);
globalVariable = {}; var globalVariable = {};
assert.sameValue(globalVariable, global.globalVariable); assert.sameValue(globalVariable, global.globalVariable);
...@@ -8,6 +8,7 @@ description: > ...@@ -8,6 +8,7 @@ description: >
negative: negative:
phase: early phase: early
type: SyntaxError type: SyntaxError
flags: [onlyStrict]
---*/ ---*/
{ function f() {} function f() {} } { function f() {} function f() {} }
...@@ -19,7 +19,7 @@ iter1.next().then(function(result) { ...@@ -19,7 +19,7 @@ iter1.next().then(function(result) {
assert.sameValue( assert.sameValue(
result.done, false, "Without right-hand-side: first result `done` flag"); result.done, false, "Without right-hand-side: first result `done` flag");
}).then(undefined, $DONE); }).then(undefined, $DONE);
iter1.next(function(result) { iter1.next().then(function(result) {
assert.sameValue( assert.sameValue(
result.value, undefined, "Without right-hand-side: second result `value`"); result.value, undefined, "Without right-hand-side: second result `value`");
assert.sameValue( assert.sameValue(
...@@ -33,7 +33,7 @@ iter2.next().then(function(result) { ...@@ -33,7 +33,7 @@ iter2.next().then(function(result) {
assert.sameValue( assert.sameValue(
result.done, false, "With right-hand-side: first result `done` flag"); result.done, false, "With right-hand-side: first result `done` flag");
}).then(undefined, $DONE); }).then(undefined, $DONE);
iter2.next(function(result) { iter2.next().then(function(result) {
assert.sameValue( assert.sameValue(
result.value, undefined, "With right-hand-side: second result `value`"); result.value, undefined, "With right-hand-side: second result `value`");
assert.sameValue( assert.sameValue(
......
...@@ -53,7 +53,7 @@ assert( ...@@ -53,7 +53,7 @@ assert(
var allKeys = Reflect.ownKeys(ns); var allKeys = Reflect.ownKeys(ns);
assert( assert(
allKeys.length > 11, allKeys.length >= 11,
'at least as many keys as defined by the module and the specification' 'at least as many keys as defined by the module and the specification'
); );
assert.sameValue(allKeys[0], 'a_local1'); assert.sameValue(allKeys[0], 'a_local1');
......
...@@ -55,7 +55,7 @@ assert.sameValue(stringKeys[15], '\u03c0', 'stringKeys[15] === "\u03c0"'); ...@@ -55,7 +55,7 @@ assert.sameValue(stringKeys[15], '\u03c0', 'stringKeys[15] === "\u03c0"');
var allKeys = Reflect.ownKeys(ns); var allKeys = Reflect.ownKeys(ns);
assert( assert(
allKeys.length > 17, allKeys.length >= 17,
'at least as many keys as defined by the module and the specification' 'at least as many keys as defined by the module and the specification'
); );
assert.sameValue(allKeys[0], '$', 'allKeys[0] === "$"'); assert.sameValue(allKeys[0], '$', 'allKeys[0] === "$"');
......
...@@ -11,4 +11,4 @@ flags: [module] ...@@ -11,4 +11,4 @@ flags: [module]
import * as ns from './set-prototype-of-null.js'; import * as ns from './set-prototype-of-null.js';
assert.sameValue(typeof Object.setPrototypeOf, 'function'); assert.sameValue(typeof Object.setPrototypeOf, 'function');
assert.sameValue(ns, Object.setPrototypeOf(ns, null); assert.sameValue(ns, Object.setPrototypeOf(ns, null));
// Copyright 2016 Microsoft, Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Brian Terlson <brian.terlson@microsoft.com>
esid: pending
description: >
Async generators are not a thing (yet)
negative:
phase: early
type: SyntaxError
---*/
async function* foo() { }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment