Skip to content

Instantly share code, notes, and snippets.

@Sebmaster
Sebmaster / urltestdata.txt
Created July 10, 2015 01:57
platform-tests
# FORMAT NOT DOCUMENTED YET (parser is urltestparser.js)
# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js
http://example\t.\norg http://example.org/foo/bar s:http h:example.org p:/
http://user:pass@foo:21/bar;par?b#c s:http u:user pass:pass h:foo port:21 p:/bar;par q:?b f:#c
http:foo.com s:http h:example.org p:/foo/foo.com
\t\s\s\s:foo.com\s\s\s\n s:http h:example.org p:/foo/:foo.com
\sfoo.com\s\s s:http h:example.org p:/foo/foo.com
a:\t\sfoo.com s:a p:\sfoo.com
http://f:21/\sb\s?\sd\s#\se\s s:http h:f port:21 p:/%20b%20 q:?%20d%20 f:#\se
"use strict";
const conversions = require("webidl-conversions");
const Impl = require("../implementation/EventTarget.js");
const initialized = require("./utils.js").initialized;
class EventTarget {
constructor() {
if (arguments[0] !== module.exports.secret && !this[initialized]) {
@Sebmaster
Sebmaster / domains-by-async.js
Last active October 4, 2017 16:42
How domains can be emulated with async_hooks
const hooks = async_hooks.create()
setTimeout(() => { // some async task
setImmediate(() => { // another one
throw new Error(); // woops!
})
}, 1000)
/*
With hooks: