Instantly share code, notes, and snippets.

View readme.md
mkdir test262-transformers
export TRANSFORMERS=$PWD/test262-transformers
cd test262-transformers
npm init -y
npm install --save @babel/core @babel/preset-env
touch spec.js 

Copy the contents to spec.js into your local spec.js

View audit.js
/*
mkdir sort-audit;
cd sort-audit;
npm init -y;
npm install glob;
wget https://gist.githubusercontent.com/rwaldron/d99fab1594f8a15d3dd2b3e56fcbe09a/raw/audit.js
wget https://s3.amazonaws.com/test-results.bocoup.com/test262/parsed-v8.json
wget https://s3.amazonaws.com/test-results.bocoup.com/test262/parsed-chakra.json
wget https://s3.amazonaws.com/test-results.bocoup.com/test262/parsed-javascriptcore.json
View files.txt
This file has been truncated, but you can view the full file.
0
arrayContains.js
arrayContains.js
arrayContains.js
----------------
1
verifyProperty-value.js
verifyProperty-value.js
verifyProperty-value.js
View cssunitvalue-is-not-easy-to-use-as-extension-handler.js
// https://www.w3.org/TR/css-typed-om-1/#simple-numeric
class CSSUnitValue {
constructor(value, unit) {
this.value = value;
this.unit = unit;
}
toString() {
// https://www.w3.org/TR/css-typed-om-1/#numericvalue-serialization
// 4. Otherwise, if unit is "percentage", append "%" to s, then return s.
return `${this.value}${this.unit === "percent" ? "%" : ""}`;
View monotonicnow.cpp
JsValueRef __stdcall WScriptJsrt::MonotonicNowCallback(JsValueRef callee, bool isConstructCall, JsValueRef *arguments, unsigned short argumentCount, void *callbackState)
{
HRESULT hr = E_FAIL;
JsValueRef returnValue = JS_INVALID_REFERENCE;
JsErrorCode errorCode = JsNoError;
IfJsrtErrorSetGo(ChakraRTInterface::JsGetUndefinedValue(&returnValue));
using std::chrono::duration_cast;
using std::chrono::milliseconds;
View wake-in-order-standalone.js
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-atomics.wake
description: >
Test that Atomics.wake wakes agents in the order they are waiting.
features: [Atomics, SharedArrayBuffer, TypedArray]
---*/
View results.txt
$ test262-runner "test/language/expressions/**/tco*.js"
--hostType=d8
FAIL test/language/expressions/call/tco-call-args.js (strict mode)
Expected no error, got RangeError: Maximum call stack size exceeded
FAIL test/language/expressions/call/tco-member-args.js (strict mode)
Expected no error, got RangeError: Maximum call stack size exceeded
FAIL test/language/expressions/call/tco-non-eval-function-dynamic.js (default)
Expected no error, got RangeError: Maximum call stack size exceeded
View 0001-Enable-SharedArrayBuffer-for-Testing.patch
From 4aebb770e48493f9ca46ca708a6271c8b0ef3045 Mon Sep 17 00:00:00 2001
From: Rick Waldron <waldron.rick@gmail.com>
Date: Mon, 26 Feb 2018 12:33:54 -0500
Subject: [PATCH] Enable SharedArrayBuffer for Testing
---
Source/WTF/wtf/Platform.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
View Setting up Google Cloud Storage with CORS for Web Fonts.md

Login:

Google Cloud Storage

You'll want to login using an official Google account (i.e. if this is for your company, use the comapany Gmail account vs. a personal one.)

When logging in, you might be prompted to verify the account; if so, enter your cell number to get a verification e-mail or phone call.

Once verified, you'll have to agree to the terms of service; do that, and click continue.

View array-oob.js
/*
Discovered in https://github.com/tc39/test262/blob/master/test/built-ins/Array/S15.4_A1.1_T10.js
*/
var x = [];
var k = 1;
for (var i = 0; i < 32; i++) {
k = k * 2;
x[k - 2] = k;
}