1 of 16

Test262

TC39 2019-07

Test262 Updates

@bocoup

bocoup.com

2 of 16

Since June

  • Several tests for Intl.*
  • Coverage for WeakRefs + FinalizationGroups
  • More coverage for Class Fields (including private, etc)
  • More coverage Numeric Separators and BigInt
  • Coverage for StatementList!

Test262 Updates

@bocoup

bocoup.com

3 of 16

Missing a basic coverage

Test262 Updates

@bocoup

bocoup.com

4 of 16

StatementList

  • function fn() {}() => { return 42; };
  • {length:3000}['length']
  • class C {}{x: 42}{}{}{}{}{}{}{}{}{}{}[];
  • {}let a, b = 42;b;
  • {1} 2;

https://github.com/tc39/test262/pull/2243

Test262 Updates

@bocoup

bocoup.com

5 of 16

Division

var instance = 60, of = 6, g = 2;

var notRegExp = instance/of/g;

assert.sameValue(notRegExp, 5);

https://github.com/tc39/test262/pull/2244

Test262 Updates

@bocoup

bocoup.com

6 of 16

WeakRefs

  • Usage of a custom $262.gc() API in Test262 only.
  • Problem: per specs, we can't mandate GC to collect refs.
  • WeakRef/FinalizationGroup is already too loose, cleanup execution is also not guaranteed per GC execution.

Test262 Updates

@bocoup

bocoup.com

7 of 16

WeakRefs

  • Usage of a custom $262.gc() API in Test262 only.
    • Ideally, this would enforce an "effective" GC call

Test262 Updates

@bocoup

bocoup.com

8 of 16

WeakRefs

  • If we can't have a GC hook ($262.gc()):
    • We need to remove all the landed tests for WeakRef + FinalizationGroup relying on it.

Test262 Updates

@bocoup

bocoup.com

9 of 16

WeakRefs

  • Tentative solution: Use custom hook $262.gc() to require collection?
    • It can return a promise to wait for a event loop.
    • Problems: It might not be possible/usable for JSC

Test262 Updates

@bocoup

bocoup.com

10 of 16

Numeric Separator + BigInt

  • Shipped tests for Numeric Separator in BigInt literals!
  • https://github.com/tc39/test262/pull/2252

Test262 Updates

@bocoup

bocoup.com

11 of 16

BigInt + NonOctal

  • BigInt is disallowed in LegacyOctalIntegerLiteral
  • It is currently allowed in NonOctalDecimalIntegerLiteral
  • Proposal: disallow it!
  • https://github.com/tc39/proposal-bigint/issues/208
  • (we have tests passing on V8)

https://github.com/tc39/test262/pull/2253

Test262 Updates

@bocoup

bocoup.com

12 of 16

Consistency

  • Numeric Separators are disallowed in LegacyOctalIntegerLiteral and NonOctalDecimalIntegerLiteral
  • The change would make BigInt consistent.
    • Numeric Separators would be available in any BigInt literal

Test262 Updates

@bocoup

bocoup.com

13 of 16

Object.keys order

Test262 Updates

@bocoup

bocoup.com

14 of 16

Plans

Test262 Updates

@bocoup

bocoup.com

15 of 16

Engines++

  • Engine262, Hermes, QuickJS, Moddable XS v9.0.0, ...
  • Please allow integration with eshost and jsvu!
  • https://test262.report/browse/?engines=xs (WOW at 92%!)
  • Goal: add them all!

Test262 Updates

@bocoup

bocoup.com

16 of 16

Questions?

Test262 Updates

@bocoup

bocoup.com