diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2017-07-14 11:37:24 -0400 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2017-07-14 11:37:24 -0400 |
commit | 4ea2931f169d4a4b5a9a4a7c731cc92bf7b3e13c (patch) | |
tree | 4fef9263ca672c61e3631e8c09d228cc809edf21 /harness | |
parent | 69b889150d91c352e32297af5bdfca87cfb78626 (diff) | |
download | qtdeclarative-testsuites-4ea2931f169d4a4b5a9a4a7c731cc92bf7b3e13c.tar.gz |
Update all harness files to pass linting. (#1153)
```
$ python tools/lint/lint.py --whitelist lint.whitelist harness/*.js
Linting 25 files.
Linting complete. 0 errors found.
```
- Renames detachArrayBuffer-$262.detachArrayBuffer.js -> detachArrayBuffer-host-detachArrayBuffer.js (previous naming prevents command-click from terminal)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'harness')
-rw-r--r-- | harness/arrayContains.js | 9 | ||||
-rw-r--r-- | harness/assert.js | 7 | ||||
-rw-r--r-- | harness/assertRelativeDateMs.js | 11 | ||||
-rw-r--r-- | harness/atomicsHelper.js | 11 | ||||
-rw-r--r-- | harness/byteConversionValues.js | 16 | ||||
-rw-r--r-- | harness/compareArray.js | 9 | ||||
-rw-r--r-- | harness/dateConstants.js | 4 | ||||
-rw-r--r-- | harness/decimalToHexString.js | 4 | ||||
-rw-r--r-- | harness/detachArrayBuffer.js | 10 | ||||
-rw-r--r-- | harness/doneprintHandle.js | 7 | ||||
-rw-r--r-- | harness/fnGlobalObject.js | 8 | ||||
-rw-r--r-- | harness/nans.js | 15 | ||||
-rw-r--r-- | harness/nativeFunctionMatcher.js | 11 | ||||
-rw-r--r-- | harness/promiseHelper.js | 11 | ||||
-rw-r--r-- | harness/propertyHelper.js | 7 | ||||
-rw-r--r-- | harness/proxyTrapsHelper.js | 8 | ||||
-rw-r--r-- | harness/regExpUtils.js | 7 | ||||
-rw-r--r-- | harness/simdUtilities.js | 7 | ||||
-rw-r--r-- | harness/sta.js | 12 | ||||
-rw-r--r-- | harness/tcoHelper.js | 15 | ||||
-rw-r--r-- | harness/testAtomics.js | 5 | ||||
-rw-r--r-- | harness/testBuiltInObject.js | 4 | ||||
-rw-r--r-- | harness/testIntl.js | 13 | ||||
-rw-r--r-- | harness/testTypedArray.js | 4 | ||||
-rw-r--r-- | harness/timer.js | 6 |
25 files changed, 180 insertions, 41 deletions
diff --git a/harness/arrayContains.js b/harness/arrayContains.js index 5f758b933..d68a42184 100644 --- a/harness/arrayContains.js +++ b/harness/arrayContains.js @@ -1,6 +1,11 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Verify that a subArray is contained within an array. +---*/ + /** - * Verify that a subArray is contained within an array. - * * @param {Array} array * @param {Array} subArray */ diff --git a/harness/assert.js b/harness/assert.js index 1bd3d31fd..4f4df41a1 100644 --- a/harness/assert.js +++ b/harness/assert.js @@ -1,3 +1,10 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of assertion functions used throughout test262 +---*/ + function assert(mustBeTrue, message) { if (mustBeTrue === true) { return; diff --git a/harness/assertRelativeDateMs.js b/harness/assertRelativeDateMs.js index 20eb4b259..a4ad32c52 100644 --- a/harness/assertRelativeDateMs.js +++ b/harness/assertRelativeDateMs.js @@ -1,10 +1,13 @@ // Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Verify that the given date object's Number representation describes the + correct number of milliseconds since the Unix epoch relative to the local + time zone (as interpreted at the specified date). +---*/ + /** - * Verify that the given date object's Number representation describes the - * correct number of milliseconds since the Unix epoch relative to the local - * time zone (as interpreted at the specified date). - * * @param {Date} date * @param {Number} expectedMs */ diff --git a/harness/atomicsHelper.js b/harness/atomicsHelper.js index 5854a3630..526506170 100644 --- a/harness/atomicsHelper.js +++ b/harness/atomicsHelper.js @@ -1,4 +1,9 @@ -// The amount of slack allowed for testing time-related Atomics methods (i.e. -// wait and wake). The absolute value of the difference of the observed time -// and the expected time must be epsilon-close. +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + The amount of slack allowed for testing time-related Atomics methods (i.e. + wait and wake). The absolute value of the difference of the observed time + and the expected time must be epsilon-close. +---*/ var $ATOMICS_MAX_TIME_EPSILON = 100; diff --git a/harness/byteConversionValues.js b/harness/byteConversionValues.js index a2074aefc..bc7b9efdb 100644 --- a/harness/byteConversionValues.js +++ b/harness/byteConversionValues.js @@ -1,13 +1,13 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. - -/** - * Provide a list for original and expected values for different byte - * conversions. - * This helper is mostly used on tests for TypedArray and DataView, and each - * array from the expected values must match the original values array on every - * index containing its original value. - */ +/*--- +description: | + Provide a list for original and expected values for different byte + conversions. + This helper is mostly used on tests for TypedArray and DataView, and each + array from the expected values must match the original values array on every + index containing its original value. +---*/ var byteConversionValues = { values: [ 127, // 2 ** 7 - 1 diff --git a/harness/compareArray.js b/harness/compareArray.js index 228a6aaae..44b92ea02 100644 --- a/harness/compareArray.js +++ b/harness/compareArray.js @@ -1,5 +1,10 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Compare the contents of two arrays +---*/ -//----------------------------------------------------------------------------- function compareArray(a, b) { if (b.length !== a.length) { return false; @@ -16,4 +21,4 @@ function compareArray(a, b) { assert.compareArray = function(actual, expected, message) { assert(compareArray(actual, expected), `Expected [${actual.join(", ")}] and [${expected.join(", ")}] to have the same contents. ${message}`); -} +}; diff --git a/harness/dateConstants.js b/harness/dateConstants.js index ebf2d75e5..14213b8b5 100644 --- a/harness/dateConstants.js +++ b/harness/dateConstants.js @@ -1,5 +1,9 @@ // Copyright (C) 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of date-centric values +---*/ var date_1899_end = -2208988800001; var date_1900_start = -2208988800000; diff --git a/harness/decimalToHexString.js b/harness/decimalToHexString.js index 36a2bb5b4..c531c5f88 100644 --- a/harness/decimalToHexString.js +++ b/harness/decimalToHexString.js @@ -1,5 +1,9 @@ // Copyright (C) 2017 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of various encoding operations. +---*/ function decimalToHexString(n) { var hex = "0123456789ABCDEF"; diff --git a/harness/detachArrayBuffer.js b/harness/detachArrayBuffer.js index 6e9982e99..df526d662 100644 --- a/harness/detachArrayBuffer.js +++ b/harness/detachArrayBuffer.js @@ -1,3 +1,13 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + A function used in the process of asserting correctness of TypedArray objects. + + $262.detachArrayBuffer is defined by a host. + +---*/ + function $DETACHBUFFER(buffer) { if (!$262 || typeof $262.detachArrayBuffer !== "function") { throw new Test262Error("No method available to detach an ArrayBuffer"); diff --git a/harness/doneprintHandle.js b/harness/doneprintHandle.js index e5e43821d..625feef57 100644 --- a/harness/doneprintHandle.js +++ b/harness/doneprintHandle.js @@ -1,3 +1,10 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + +---*/ + function __consolePrintHandle__(msg){ print(msg); } diff --git a/harness/fnGlobalObject.js b/harness/fnGlobalObject.js index 9b39cdd9e..1907c2520 100644 --- a/harness/fnGlobalObject.js +++ b/harness/fnGlobalObject.js @@ -1,4 +1,10 @@ -//----------------------------------------------------------------------------- +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Produce a reliable global object +---*/ + var __globalObject = Function("return this;")(); function fnGlobalObject() { return __globalObject; diff --git a/harness/nans.js b/harness/nans.js index c2392e132..e541dba02 100644 --- a/harness/nans.js +++ b/harness/nans.js @@ -1,9 +1,12 @@ -/** - * A collection of NaN values produced from expressions that have been observed - * to create distinct bit representations on various platforms. These provide a - * weak basis for assertions regarding the consistent canonicalization of NaN - * values in Array buffers. - */ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + A collection of NaN values produced from expressions that have been observed + to create distinct bit representations on various platforms. These provide a + weak basis for assertions regarding the consistent canonicalization of NaN + values in Array buffers. +---*/ var distinctNaNs = [ 0/0, Infinity/Infinity, -(0/0), Math.pow(-1, 0.5), -Math.pow(-1, 0.5) ]; diff --git a/harness/nativeFunctionMatcher.js b/harness/nativeFunctionMatcher.js index f902f3414..0a2d248a3 100644 --- a/harness/nativeFunctionMatcher.js +++ b/harness/nativeFunctionMatcher.js @@ -1,5 +1,8 @@ -/** - * This regex makes a best-effort determination that the tested string matches - * the NativeFunction grammar production without requiring a correct tokeniser. - */ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + This regex makes a best-effort determination that the tested string matches + the NativeFunction grammar production without requiring a correct tokeniser. +---*/ const NATIVE_FUNCTION_RE = /\bfunction\b[\s\S]*\([\s\S]*\)[\s\S]*\{[\s\S]*\[[\s\S]*\bnative\b[\s\S]+\bcode\b[\s\S]*\][\s\S]*\}/; diff --git a/harness/promiseHelper.js b/harness/promiseHelper.js index 0bdff33e4..66ae36daf 100644 --- a/harness/promiseHelper.js +++ b/harness/promiseHelper.js @@ -1,4 +1,13 @@ -//----------------------------------------------------------------------------- +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Check that an array contains a numeric sequence starting at 1 + and incrementing by 1 for each entry in the array. Used by + Promise tests to assert the order of execution in deep Promise + resolution pipelines. +---*/ + function checkSequence(arr, message) { arr.forEach(function(e, i) { if (e !== (i+1)) { diff --git a/harness/propertyHelper.js b/harness/propertyHelper.js index 1f04ea7f7..da69764dc 100644 --- a/harness/propertyHelper.js +++ b/harness/propertyHelper.js @@ -1,3 +1,10 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to safely verify the correctness of + property descriptors. +---*/ function verifyProperty(obj, name, desc, options) { assert( diff --git a/harness/proxyTrapsHelper.js b/harness/proxyTrapsHelper.js index 402684cfb..a438be9f0 100644 --- a/harness/proxyTrapsHelper.js +++ b/harness/proxyTrapsHelper.js @@ -1,3 +1,11 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Used to assert the correctness of object behavior in the presence + and context of Proxy objects. +---*/ + function allowProxyTraps(overrides) { function throwTest262Error(msg) { return function () { throw new Test262Error(msg); }; diff --git a/harness/regExpUtils.js b/harness/regExpUtils.js index 2db568ab2..bdb956427 100644 --- a/harness/regExpUtils.js +++ b/harness/regExpUtils.js @@ -1,3 +1,10 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of RegExp objects. +---*/ + function buildString({ loneCodePoints, ranges }) { const CHUNK_SIZE = 10000; let result = String.fromCodePoint(...loneCodePoints); diff --git a/harness/simdUtilities.js b/harness/simdUtilities.js index c8396a777..ba711a5ec 100644 --- a/harness/simdUtilities.js +++ b/harness/simdUtilities.js @@ -1,5 +1,12 @@ // Copyright (C) 2016 ecmascript_simd authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of SIMD objects. + + No longer used in any tests. +---*/ + function minNum(x, y) { return x != x ? y : diff --git a/harness/sta.js b/harness/sta.js index 39fc5b98b..341c21e76 100644 --- a/harness/sta.js +++ b/harness/sta.js @@ -1,5 +1,13 @@ -/// Copyright (c) 2012 Ecma International. All rights reserved. -/// This code is governed by the BSD license found in the LICENSE file. +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Provides both: + + - An error class to avoid false positives when testing for thrown exceptions + - A function to explicitly throw an exception using the Test262Error class +---*/ + function Test262Error(message) { this.message = message || ""; diff --git a/harness/tcoHelper.js b/harness/tcoHelper.js index 5e9bee225..ecae61293 100644 --- a/harness/tcoHelper.js +++ b/harness/tcoHelper.js @@ -1,4 +1,13 @@ -// This defines the number of consecutive recursive function calls that must be -// made in order to prove that stack frames are properly destroyed according to -// ES2015 tail call optimization semantics. +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + This defines the number of consecutive recursive function calls that must be + made in order to prove that stack frames are properly destroyed according to + ES2015 tail call optimization semantics. +---*/ + + + + var $MAX_ITERATIONS = 100000; diff --git a/harness/testAtomics.js b/harness/testAtomics.js index 2570e3ab8..81f6af3a6 100644 --- a/harness/testAtomics.js +++ b/harness/testAtomics.js @@ -1,5 +1,10 @@ // Copyright (C) 2017 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of SharedArrayBuffer objects. +---*/ + /** * Calls the provided function for a each bad index that should throw a diff --git a/harness/testBuiltInObject.js b/harness/testBuiltInObject.js index c3ce74982..c78c0d732 100644 --- a/harness/testBuiltInObject.js +++ b/harness/testBuiltInObject.js @@ -1,5 +1,9 @@ // Copyright 2012 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + A function used to assert the correctness of built-in objects. +---*/ /** * @description Tests that obj meets the requirements for built-in objects diff --git a/harness/testIntl.js b/harness/testIntl.js index ddf953acd..01315b175 100644 --- a/harness/testIntl.js +++ b/harness/testIntl.js @@ -1,11 +1,14 @@ -// Copyright 2011-2012 Norbert Lindenberg. All rights reserved. -// Copyright 2012-2013 Mozilla Corporation. All rights reserved. +// Copyright (C) 2011 2012 Norbert Lindenberg. All rights reserved. +// Copyright (C) 2012 2013 Mozilla Corporation. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + This file contains shared functions for the tests in the conformance test + suite for the ECMAScript Internationalization API. +author: Norbert Lindenberg +---*/ /** - * This file contains shared functions for the tests in the conformance test - * suite for the ECMAScript Internationalization API. - * @author Norbert Lindenberg */ diff --git a/harness/testTypedArray.js b/harness/testTypedArray.js index aece79d8e..2699214ca 100644 --- a/harness/testTypedArray.js +++ b/harness/testTypedArray.js @@ -1,5 +1,9 @@ // Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of TypedArray objects. +---*/ /** * Array containing every typed array constructor. diff --git a/harness/timer.js b/harness/timer.js index f1089108b..273793989 100644 --- a/harness/timer.js +++ b/harness/timer.js @@ -1,3 +1,9 @@ +// Copyright (C) 2017 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Used in website/scripts/sth.js +---*/ //setTimeout is not available, hence this script was loaded if (Promise === undefined && this.setTimeout === undefined) { if(/\$DONE()/.test(code)) |