Skip to content

Instantly share code, notes, and snippets.

View avdg's full-sized avatar

Anthony Van de Gejuchte avdg

View GitHub Profile
@avdg
avdg / README.md
Last active May 5, 2016 16:26
Test262 ecmascript 6 test result

Uglify checkout e36e07fa77859bcd461234856c06c95cee0cfffe (harmony) Test262 checkout 4980fd264e49aab0fe0193ecd08f41890292a1ae (master)

process.versions:

{ http_parser: '2.6.0',
  node: '5.3.0',
  v8: '4.6.85.31',
 uv: '1.8.0',
@avdg
avdg / es6.ebnf
Last active September 15, 2023 06:04
ES6 bnf grammer - See https://avdg.github.io/es6.xhtml
/* ebnf file for es 6 - MAY CONTAIN ERRORS / DISAMBIGUITY */
Grammer::= Statement
/* Lexical grammer */
SourceCharacter ::= #x0000-#x10FFFF
InputElementDiv ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | RightBracePunctuator
InputElementRegExp ::= WhiteSpace | LineTerminator | Comment | CommonToken | RightBracePunctuator | RegularExpressionLiteral
InputElementRegExpOrTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | RegularExpressionLiteral | TemplateSubstitutionTail
InputElementTemplateTail ::= WhiteSpace | LineTerminator | Comment | CommonToken | DivPunctuator | TemplateSubstitutionTail
WhiteSpace ::= "<TAB>" | "<VT>" | "<FF>" | "<SP>" | "<NBSP>" | "<ZWNBSP>" | "<USP>"
@avdg
avdg / README.md
Last active January 20, 2016 15:15
Test262 ecmascript 5.1 test results

Uglify checkout: 26641f3fb20bce9394c3989bea0099dcd209be61 Test262 checkout (es5-tests branch): 7da91bceb9ce7613f87db47ddd1292a2dda58b42

process.versions:

{ http_parser: '2.6.0',
  node: '5.3.0',
  v8: '4.6.85.31',
 uv: '1.8.0',
"use strict";
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
uglify: {
options: {
compress: {
global_defs: {
@avdg
avdg / example.js
Last active January 15, 2016 10:14
UglifyJS codegen fail example with getters and setters
var UglifyJS = require("uglify-js"); // Or wherever UglifyJS is
var test = "var strict_mode = false;\nfunction testRun(id, path, description, codeString, result, error) {\n if (result!==\"pass\") {\n throw new Error(\"Test \'\" + path + \"\'failed: \" + error);\n }\n}\n\nfunction testFinished() {\n \/\/no-op\n}\nfunction compareArray(aExpected, aActual) {\n if (aActual.length != aExpected.length) {\n return false;\n }\n\n aExpected.sort();\n aActual.sort();\n\n var s;\n for (var i = 0; i < aExpected.length; i++) {\n if (aActual[i] !== aExpected[i]) {\n return false;\n }\n }\n return true;\n}\n\n\/\/-----------------------------------------------------------------------------\nfunction arrayContains(arr, expected) {\n var found;\n for (var i = 0; i < expected.length; i++) {\n found = false;\n for (var j = 0; j < arr.length; j++) {\n if (expected[i] === arr[j]) {\n found = true;\n break
@avdg
avdg / gist:35f1bd07b3082450ab48
Created January 12, 2016 22:50
Test case code compression
var arguments;
var e = function() {var arguments = 5; return arguments};
var f = function() {return arguments.length};
var e = function() {var a = 5; return a};
@avdg
avdg / arguments.length.js
Last active January 12, 2016 22:01
Test262 test for failing test ch10\10.6\10.6-6-3 and ch10\10.6\10.6-6-4 in UglifyJS2
var UglifyJS = require('uglify-js'); // or require("./tools/node");
var ast = UglifyJS.parse("var arguments; var f = function() {arguments.length}");
ast.figure_out_scope();
if (ast.body[1].definitions[0].value.find_variable("arguments").scope === ast.body[1].definitions[0].value) {
console.log("TEST PASSED");
} else {
console.log("TEST FAILED");
};
@avdg
avdg / 10.6-6-4.js
Last active December 15, 2015 23:04
UglifyJS2 test262 argument object crash test II
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 10.6-6-4
description: >
'length' property of arguments object for 0 argument function call
is 0 even with formal parameters
flags: [noStrict]
---*/
@avdg
avdg / 10.6-6-3.js
Created December 15, 2015 21:34
UglifyJS2 test262 argument object crash test
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 10.6-6-3
description: >
'length' property of arguments object for 0 argument function
exists
flags: [noStrict]
---*/