Skip to content

Instantly share code, notes, and snippets.

diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js
index ebef428..ae51a22 100644
--- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/ServiceWorkerGlobalScope/resources/extendable-message-event-constructor-worker.js
@@ -1,38 +1,40 @@
-importScripts('../../resources/worker-testharness.js');
+importScripts('/resources/testharness.js');
+var test_object = { wanwan: 123 };
+var channel1 = new MessageChannel();
@jugglinmike
jugglinmike / parse.js
Created March 5, 2017 18:35
Cheerio/parse5 research
'use strict';
var cheerio = require('../cheerio');
var doc = [
'<!DOCTYPE html>',
'<html>',
'<body>',
' <h1>Hello, world.</h1>',
'</body>',
'</html>'
@jugglinmike
jugglinmike / index.html
Last active January 16, 2017 23:17
`<details>` element interaction (with small documents)
<!DOCTYPE html>
<details>
<summary id="d">Summary</summary>
Content
</details>
<script>document.getElementById('d').click();</script>
@jugglinmike
jugglinmike / index.html
Last active January 16, 2017 23:11
`<details>` element interaction (with larger documents)
<!DOCTYPE html>
<details>
<summary id="d">Summary</summary>
Content
</details>
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div>
@jugglinmike
jugglinmike / example-task.yml
Last active November 14, 2016 16:15
Ansible: references to `environment` object
---
- debug: var=environment
@jugglinmike
jugglinmike / all.js
Last active June 17, 2016 21:20
Promise.all inconsistency
var first;
var P = function(executor) {
if (!first) {
return new Promise(executor);
}
first = false;
return new Promise(function(_, reject) {
executor(function() { throw 1; }, reject);
});
};
/**
* An extension of ES2015 `Object.is` that distinguishes between NaN values.
*/
(function() {
var full = new Float64Array(2);
var bytes = new Uint8Array(full.buffer);
Object.reallyIs = function(a, b) {
if (!Object.is(a, b)) {
return false;
@jugglinmike
jugglinmike / test-nan.js
Created May 5, 2016 16:50
Testing Distinct NaN Representations in JavaScript
var a = new Float64Array(2);
var aBytes = new Uint8Array(a.buffer);
aBytes[6] = 248;
aBytes[7] = 255;
aBytes[14] = 248;
aBytes[15] = 127;
var nan1 = a[0];
var nan2 = a[1];
@jugglinmike
jugglinmike / tail.js
Created January 23, 2016 00:57
Statement Tail Calls
(function f(n) { if (n === 0) { return 0; } return f(n - 1); }(1000));
(function f(n) { if (n === 0) { return 0; } return 1 + f(n - 1); }(1000));
(function f(n) { if (n === 0) { return 0; } return f(n - 1) % 2; }(1000));
(function f(n) { if (n === 0) { return 0; } return new f(n - 1); }(1000));
(function f(n) { if (n === 0) { return 0; } return f(n - 1) || true; }(1000));
(function f(n) { if (n === 0) { return 0; } return false || f(n - 1); }(1000));
(function f(n) { if (n === 0) { return 0; } return f(n - 1) && true; }(1000));
(function f(n) { if (n === 0) { return 0; } return true && f(n - 1); }(1000));
(function f(n) { if (n === 0) { return 0; } { return f(n - 1); } }(1000));
(function f(n) { if (n === 0) { return 0; } { void 0; return f(n - 1); } }(1000));
@jugglinmike
jugglinmike / excellent.js
Last active January 22, 2016 18:32
Excellent
var src = '';
var max = 300000;
var idx, exception;
for (idx = max; idx > 0; --idx) {
src += 'eval(';
}
for (idx = max; idx > 0; --idx) {
src += ')';