Commit Graph

197 Commits

Author SHA1 Message Date
Alexey Shvayka 8a3fe5318d Merge "length" tests & refactor using propertyHelper.js harness 2020-05-06 11:56:49 -04:00
Alexey Shvayka 1c3d1e3026 Object.prototype.toString: Improve revoked Proxy coverage 2020-05-06 11:51:46 -04:00
Alexey Shvayka c9ce3be95d Add Object.seal test 2020-04-25 18:45:48 -04:00
Alexey Shvayka feaa555fc3 Add Object.isSealed test 2020-04-25 18:45:48 -04:00
Alexey Shvayka a65d0bfb42 Add Object.isFrozen test 2020-04-25 18:45:48 -04:00
Alexey Shvayka 521446b36b Add Object.freeze test 2020-04-25 18:45:48 -04:00
Alexey Shvayka 07ff2ffa4a Add Object.defineProperties test 2020-04-25 18:45:48 -04:00
Alexey Shvayka 56cbc61e42 Add Object.getOwnPropertyDescriptors test 2020-04-25 18:45:48 -04:00
Alexey Shvayka 2183fa7e4e Add Object.assign test 2020-04-25 18:45:48 -04:00
Alexey Shvayka eca34edd7e Drop "the" and align license headers 2020-04-23 10:48:16 -04:00
Alexey Shvayka b273affa2c Add Object.values test 2020-03-23 14:50:33 -04:00
Alexey Shvayka 5874ca46fc Add Object.keys test 2020-03-23 14:50:33 -04:00
Alexey Shvayka c370276c65 Add Object.getOwnPropertySymbols test 2020-03-23 14:50:33 -04:00
Alexey Shvayka 62c9541be4 Add Object.getOwnPropertyNames test 2020-03-23 14:50:33 -04:00
Alexey Shvayka 021b8f2b33 Add Object.getOwnPropertyDescriptors test 2020-03-23 14:50:33 -04:00
Alexey Shvayka b94190e387 Add Object.entries test 2020-03-23 14:50:33 -04:00
Alexey Shvayka 4383f2c6ba Add Object.{freeze,preventExtensions,seal} abrupt completion tests (#2468)
* Add Object.freeze test

* Add Object.preventExtensions test

* Add Object.seal test
2020-01-14 11:31:45 -05:00
Gus Caplan 502cc20010 fix delete test, add error tests, fix lint (#2453) 2019-12-21 16:57:41 -05:00
Alexey Shvayka 19fd4bea79 Improve Object.prototype.isPrototypeOf coverage (#2446) 2019-12-18 21:33:31 -05:00
Kevin Gibbons cadd47aa5f Add test for for-in order (#2432)
* Add EnumerateObjectProperties tests for builtins which use it

* Add tests for EnumerateObjectProperties for for-in

* Add feature flag for for-in-order
2019-12-18 11:25:20 -05:00
Alexey Shvayka da9612db98 Add some more Proxy/ownKeys invariants tests (#2413)
* Defer making [[ProxyTarget]] non-extensible

* Fix typo in method name

* Add last Object.keys with Proxy invariant test

* Add Object.getOwnPropertySymbols with Proxy invariants tests

* Add Object.getOwnPropertyNames with Proxy invariants tests

* Replace "es6id" with "esid" in Object.getOwnPropertySymbols tests
2019-11-11 15:02:07 -05:00
Alexey Shvayka 1aac32e2f8 Improve Proxy/ownKeys invariants coverage (#2384)
* Add non-configurable invariant test

* Add non-extensible invariant test
2019-10-08 14:54:46 -04:00
Leo Balter e2903e2648
Merge pull request #2366 from bocoup/unnecessary-includes
Remove unnecessary "includes" directives
2019-09-27 16:46:22 -04:00
Leo Balter 83d9f750c9
Merge pull request #2376 from bocoup/ud-coverage
Improve coverage
2019-09-27 16:30:13 -04:00
jugglinmike 479ea0ec0b Avoid false positive (#2375)
Prior to this patch, the modified test would pass if no exception was
produced. Use the `assert.throws` utility function to concisely express
the expectation more completely.
2019-09-27 16:25:07 -04:00
Mike Pennisi 9cd62ffbd7 Improve coverage: ctor props of the global object
Prior to this commit, the descriptors of the constructor properties of
the global object were verified inconsistently, many independent
assertions occured in the same file, and that file test was poorly
located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi 1e4e524251 Update tests to use APIs defined by included files
The `$DETACHBUFFER` function is the preferred mechanism for detaching
array buffers.

Likewise, `verifyNotWritable` is the preferred mechanism for asserting
lack of writability.
2019-09-25 13:59:24 -04:00
Alexey Shvayka ef7fd2bc27 Add "proto-from-ctor-realm" tests for Intl constructors (#2334)
* Rename "Object/proto-from-ctor.js" test

* Add missing "Symbol" features

* Add Intl.Collator test

* Add Intl.DateTimeFormat test

* Add Intl.NumberFormat test

* Add Intl.PluralRules test
2019-09-11 17:22:21 -03:00
Leo Balter 5d84854f27
Avoid usage of Object.keys when asserting order of returned values (#2320)
Fixes #2226
2019-09-04 11:38:18 -03:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Gus Caplan 2fb39cb4e9 add missing feature (#2250) 2019-07-22 12:46:59 -04:00
Leo Balter d02fe7db38
Add coverage for non object values of the Properties arg of Object.create (#2238)
Fixes #2237
2019-07-15 16:17:03 -04:00
Alexey Shvayka 19b5a5a635 Improve Object#toString coverage (#2202)
* Move proxies with non-string toStringTag to separate file

* Add coverage for async proxy functions

* Add coverage for built-ins with non-string toStringTag

* Move async proxy function tests to new file
2019-07-10 14:00:04 -04:00
Gus Caplan ceaebf7058 fix built-ins/Object/subclass-object-arg (#2200) 2019-06-19 15:48:53 -04:00
Alexey Shvayka 430ee14d90 Add Object subclass test (#2177) 2019-06-12 14:11:16 -04:00
Ross Kirsling d0f57bff72 Ensure test file YAML blocks don't have a trailing space. (#2018) 2019-01-07 11:40:39 -02:00
Peter Marshall b3efcd2f3f Consistently use spaces in features lists (#2000) 2018-12-17 17:00:04 -02:00
⭐caitp⭐ 16ef6ad10d Get rid of the leading empty line in info block (#1993)
This makes v8's _monkeyYaml happy --- without it, the info block never ends, and we fail to parse the `features` key.

An explicit indentation marker isn't used because monkeyYaml doesn't supported it, and adding it might slightly slow things down.

Using PyYAML instead was considered, but after trying it, I don't think it looks viable. [simple test cases](https://gist.github.com/caitp/4a59a67f671907c11051a1b7bd5fdaae)
2018-12-15 05:40:37 -05:00
Rick Waldron 628faa5e06 Eliminate false positives: Object.fromEntries 2018-11-30 09:31:54 -05:00
Adrian Heine né Lang 0475c127c4 Fix some generators feature flags (#1933) 2018-11-07 17:51:23 -05:00
Rick Waldron ff475fce11 Object.fromEntries: use verifyProperty; add specification details 2018-08-13 15:15:02 -04:00
Rick Waldron 55ffeaf5cf Object.fromEntries: fix file names 2018-08-13 12:24:57 -04:00
Kevin Gibbons 60b9467630 Two more simple tests 2018-08-13 10:25:09 -04:00
Kevin Gibbons 7f694d4718 Object.fromEntries: add basic tests 2018-08-13 10:25:09 -04:00
Robin Templeton 904d90d0d6 Add Object.prototype.toString tests for BigInt.
Reported by André Bargull in
<https://bugzilla.mozilla.org/show_bug.cgi?id=1464758>.
2018-05-31 15:10:50 -04:00
Valerie R Young 40883f4c6a Update filename character restriction in documention, linter and a few filenames 2018-05-11 22:19:01 -04:00
André Bargull b552dad5cb Various test cases for cross-browser compliance bugs 2018-05-03 09:27:27 -07:00
André Bargull ea6c18c5e2 Don't compute NaN values in functions (#1503)
`function nan() { return /* expression to compute NaN */ }` may not return the same implementation-distinguishable NaN value before and after JIT compilation.
2018-03-22 20:20:29 -04:00
Rick Waldron 2975694f86 Weaken tests about NaN canonicalization.
Fixes gh-1476
Closes gh-1484
2018-03-13 12:53:39 -04:00
Rick Waldron 3af53b8087 test/built-ins/Object/prototype/toString/*.js: clean up and extended fixes from gh-1473 (#1475) 2018-03-07 14:11:28 -05:00
Leo Balter ac55e29ed0 Fix yaml consistency 2018-03-06 14:36:02 -05:00
Sathya Gunasekaran 476ebcebf1 Remove whitespace between Literal and BigIntLiteralSuffix (#1452) 2018-02-22 21:55:13 -05:00
Rick Waldron a61b9cd671 built-ins/Object/*: make all indentation consistent (depth & character) (#1432) 2018-02-15 15:33:45 -05:00
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722.
2018-02-09 12:09:47 -05:00
Rick Waldron a01de4a722 js-beautify: make all indentation consistent (depth & character) (#1409) 2018-02-09 11:35:37 -05:00
Rick Waldron d7b5715e6c Fix: various lint fixes 2018-01-11 10:21:08 -05:00
Rick Waldron 73120a5492 Fix: various lint fixes 2018-01-10 17:33:03 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
André Bargull 32b1984275 Fix multiple issues in nan-equivalence.js test case 2017-11-01 08:23:42 -07:00
Leo Balter 7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
Leo Balter ca1871bafd Add missing Symbol.toStringTag feature flags 2017-09-08 10:13:50 -04:00
Leo Balter c41faf1aca Add missing Symbol features flags 2017-09-07 15:51:13 -04:00
André Bargull f3cd58335f Remove duplicate property keys from getOwnPropertyDescriptors
Because Proxies no longer allow to return duplicate property keys.
2017-09-05 11:18:06 -04:00
Robin Templeton 37beb36524
add BigInt tests 2017-08-24 15:58:14 -04:00
Leo Balter 06f2f3e810
Remove more unnecessary tests
These tests are not helpful for their respective APIs being tested.

They don't add any coverage for the built-in apis and basically check
behaviors that might conflict with a implementation defined global.
2017-05-17 19:33:54 -04:00
jugglinmike 74954bfa91 Introduce automated validation for test format (#994)
This script is intended to identify common test file formatting errors
prior to their acceptance into the project. It is designed to support
future extensions for additional validation rules.
2017-05-01 12:04:05 -04:00
⭐caitp⭐ 91c53231d0 Add tests for observable [[GetOwnProperty]] ops in EnumerableOwnProperties (#1003) 2017-04-27 17:09:05 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Leo Balter d8d6db785f Merge pull request #949 from rwaldron/755
Fixes for gh-755, per reviews
2017-04-06 12:31:40 -04:00
Rick Waldron 72e7cd699f Move proxy function proxy tests into own file
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-04-06 12:26:04 -04:00
Leonardo Balter 340543bc11
Rename top level 'name' and 'length' bindings
Fix 850
2017-03-14 12:43:24 -04:00
Rick Waldron fdd2fa9b1c Rename $ => $262. Fixes gh-802 (#823)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-03-01 16:34:15 -05:00
Claude Pache a266cfa8cb Add tests for known violation of invariants (#841)
Some popular JavaScript engines display violation of invariants about
property attributes for some non-standard but “web-reality” object
properties. Add tests against such violations

Closes #653
Fixes #649
2017-03-01 15:32:46 -05:00
Rick Waldron f280db452e Test Symbol.toStringTag overrides on primitive wrapper prototypes. Closes gh-809 (#837)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-01-20 11:55:36 -08:00
jugglinmike 71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Keith Miller ba93cfa52d Update the toString/proxy.js to test stringifing functions 2016-08-30 14:03:54 -07:00
Jordan Harband 55cf59c80d `Object.getOwnPropertyDescriptors`: add test to ensure undefined descriptors are not added. (#662)
Per https://github.com/tc39/ecma262/pull/593
2016-08-01 13:54:53 -04:00
Leonardo Balter 3868f8f765 Update test for distinct NaN replacement on DefineOwnProperty
Fixes gh-683
Ref gh-648
Ref tc39/ecma262#353
2016-07-06 11:30:33 -04:00
Leo Balter e49d2661a8 Improve assertions comparing values to NaN (#690)
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
2016-07-01 11:22:55 -07:00
Leonardo Balter 91d06f50b5 Update esid for Object.getOwnPropertyDescriptors 2016-06-15 18:09:58 -04:00
jugglinmike ee7496f713 Add tests for usage of IsArray (#667) 2016-06-10 15:07:40 -04:00
jugglinmike f1c9cef154 Add test for NaN in OrdinaryDefineOwnProperty (#648)
These semantics are currently contested, but the test reflects the
intended behavior of the latest version of the specification.
2016-06-08 12:40:39 -04:00
Mike Pennisi eb644bb2da Reduce reliance on `fnGlobalObject.js`
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00
André Bargull 1517615a21 Fix test bugs 2016-02-23 18:55:06 +01:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Jordan Harband d530c87b41 Create `proxyTrapsHelper` to throw on all traps by default. 2016-02-13 15:56:47 -08:00
Jordan Harband cf83ad5e73 s/esid/id/g 2016-02-01 23:44:48 -08:00
Jordan Harband 940d8698d1 Add test with duplicate keys.
Per https://github.com/tc39/test262/pull/484#issuecomment-178145781
2016-02-01 16:57:31 -08:00
Jordan Harband 0a5e8372aa Review feedback. 2016-02-01 10:44:25 -08:00
Jordan Harband cf578d5190 Add Object.getOwnPropertyDescriptors tests. 2016-02-01 01:45:23 -08:00
Leonardo Balter ebda746e6a Replace es7id tags with id 2016-02-12 16:22:56 -08:00
Leonardo Balter df2d760d60 Add tests for Object.prototype extensibility and its immutable prototype
Object.prototype is extensible and an immutable prototype exotic object,
it's [[Prototype]] value is null

Ref tc39/ecma262#308
2016-02-12 13:10:46 -02:00
Leonardo Balter e3c5f66a40 Fix case sentitive error on test/built-ins/Object folder
Fixes gh-482
2016-01-29 10:02:25 -05:00
André Bargull ca61d9b876 Add missing tests for "length" and "name" properties of built-in functions
Note: Already uses the updated DataView function lengths from tc39/ecma262#266 (ES2016 Draft 2015-12-20)
2016-01-15 18:12:05 +01:00
Jordan Harband 17e9f3aa00 Add Proxy tests to ensure observable semantics are maintained 2015-12-14 17:00:33 -08:00
André Bargull df9bf58204 Tests for changes introduced in ES2015 (Annex E)
- String case functions iterate over code points
- Has called before Get in Array.p.reverse
- Add test for web-compat Array.p.splice behaviour; Plus missing test for no arguments case
- ToObject no longer applied to this-value in Array.p.toLocaleString
- ToObject no longer applied to this-value in Object.p.toLocaleString
- Add tests for Object.p.propertyIsEnumerable and symbol property keys
- Add tests for Object.p.hasOwnProperty and symbol property keys
- Test property descriptor attributes of message property
- Tests for RegExp constructor checks
- Date constructor when called with date object
- TimeClip never returns negative zero
2015-09-07 17:25:55 +02:00
Rick Waldron 9ccc663936 Merge pull request #415 from anba/remove-runTestCase-finally
Replace runTestCase when used with try-finally
2015-09-04 15:20:26 -04:00
Rick Waldron a2554d909b Merge branch 'remove-runTestCase-builtins-other' of https://github.com/anba/test262 into anba-remove-runTestCase-builtins-other
# By André Bargull
# Via André Bargull
* 'remove-runTestCase-builtins-other' of https://github.com/anba/test262:
  Replace runTestCase with assert helpers, rest [test/built-ins]
  Replace runTestCase with assert helpers [test/built-ins]

Conflicts:
	test/built-ins/Array/from/S22.1.2.1_T1.js
	test/built-ins/Array/from/S22.1.2.1_T2.js
	test/built-ins/Array/from/S22.1.2.1_T3.js
2015-09-04 13:25:41 -04:00
Rick Waldron 50423896d5 Merge pull request #414 from bocoup/symbol-to-string-tag
Add tests for well-known Symbol: @@toStringTag
2015-09-02 17:15:55 -04:00
André Bargull 4ec97779fd Replace runTestCase with assert helpers, rest [test/built-ins] 2015-08-13 17:57:23 +02:00