Chiffon icon indicating copy to clipboard operation
Chiffon copied to clipboard

Breaks with ES6 - Harmony specs

Open ghost opened this issue 8 years ago • 2 comments

@polygonplanet I noticed this parser is not 100% Harmony compatible?

I tried a few different comboes, and they all failed for me.

//-
function* wrap() {\n(a = yield b)\n}

//-
async function foo() { }

//- a reference and a normal function declaration if there is a linebreak between 'async' and 'function'.
async\nfunction foo() { }

//- 
export async function foo() { }

//-
export default async function() { }

//- 'await' is valid as function names.
async function await() { }

//- async === true
(async function foo() { })

//- export default
export default (async function() { })

//- 
async a => a

//-
async () => a

//-
async (await)

//-
async yield => 1

//-
({async foo() { }})

//-
({async await() { }})

// -
({ x(...[ a, b ]){} })

// -
({ x({ a: { w, x }, b: [y, z] }, ...[a, b, c]){} })

//-
(...a) => {}

//-
(a, ...b) => {}

//-
({ a }) => {}

//-
({ a }, ...b) => {} 

//-
({ a: [a, b] }, ...c) => {}

//-
({ a: b, c }, [d, e], ...f) => {}

//-
[a, ...[b, c]] = d

//-
var [a, ...[b, c]] = d

//-
func(...a)

//-
func(a, ...b)

//-
func(...a, b)

//-
/[a-z]/u

//-
({x = 0}) => x

//-
({*yield() {}})

//-
class A { static() {} }

//-
'`${/\\d/.exec('1')[0]}` // unknown '1'

//-
var await = 0

//-
(([,]) => 0

//-
function* yield() {} // yield as function name
//-
function* foo(a = function*(b) { yield b }) { }

ghost avatar Nov 17 '16 09:11 ghost

Thanks for report! Yes, Chiffon is not 100% Harmony compatible yet. Currently, awaut/async is not supports in this module. I'll fix this.

polygonplanet avatar Nov 23 '16 22:11 polygonplanet

@polygonplanet Any time frame on when you will publish the new changes? I really like your module 👍

ghost avatar Nov 26 '16 01:11 ghost