Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
status

Leo Balter leobalter

💭
status
View GitHub Profile
View args eval.md

Current

SuperCall : super Arguments

1. Let newTarget be GetNewTarget().
2. Assert: Type(newTarget) is Object.
3. Let func be ? GetSuperConstructor().
4. Let argList be ? ArgumentListEvaluation of Arguments.
5. Let result be ? Construct(func, argList, newTarget).
View ticks.js
var p = Promise.resolve(1).then(v => console.log(v);
console.log(0);
await import('foo');
console.log(2);
p.then(() => console.log(3);
View weakrefchecklist.txt
The WeakRef Constructor
https://tc39.github.io/proposal-weakrefs/#sec-weak-ref-constructor
- [ ] is the initial value of the WeakRef property of the global object.
- [ ] is designed to be subclassable. It may be used as the value in an extends clause of a class definition. Subclass constructors that intend to inherit the specified WeakRef behaviour must include a super call to the WeakRef constructor to create and initialize the subclass instance with the internal state necessary to support the WeakRef.prototype built-in methods.
WeakRef ( target )
https://tc39.github.io/proposal-weakrefs/#sec-weak-ref-target
1. [ ] If NewTarget is undefined, throw a TypeError exception.
View uniqBy.js
function uniqBy(iter, mapFn) {
var map = new Map();
for (let item of iter) {
let key = mapFn(item);
// Use the first given key identifier
if (map.has(key)) {
continue;
}
View set-array-typedarray.txt
```js
Object.setPrototypeOf(Array.prototype, new Int8Array(0));
const a = [];
a[0] = 4;
console.log(+a[0]);
```
---
`a[0] = 4;`
View 1.thenable-ns.js
// Status of today + dynamic import() proposal, await unwraps namespace objects.
//--- a.js
export let then = async () => {/* code */};
//--- b.js
import * as ns from 'a.js';
async function fn() {
await Promise.resolve(ns); // should unwrap the "thenable" namespace
View Spec bug diagram exercise.md

The "search" event

https://github.com/whatwg/html/issues/667

Some browsers feature non-standard attributes incremental and onsearch for the <input type=search> elements. This also implies the search event being fired.

  • Specified? no
  • Proposed? no.
    • This link shows a refusal to propose the idea and reasons for it.
  • Is it a good idea? no.
    • The refusal to proposal the idea bases on the fact it's already redundant with the oninput and onsubmit event handlers
View test262.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long qw(GetOptions);
my $args = '';
GetOptions(
View gist:4ea72144711f597b34c30681fc447c89
yarn test-test262
yarn test-test262 v1.0.2
$ babel-node scripts/test262.js
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
harness: Ran 0/181 (0.00%), Passed 0/0 (100%), Failed 0/0 (100%), Skipped 181/181 (100.00%)
intl402: Ran 0/44 (0.00%), Passed 0/0 (10
View gist:0e7e089d7fff55b27a9576649bb95ae1
[~/dev/test262-integrator] (master)⚡
npm test
> test262-integrator@1.0.0 test /Users/leo/dev/test262-integrator
> node test/test.js
......
Failed: test/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
Test262Error: No method available to detach an ArrayBuffer
You can’t perform that action at this time.