intoli / remote-browser

A low-level browser automation framework built on top of the Web Extensions API standard.
Other
1.73k stars 105 forks source link

Add special handling for Safari's async arrow function serialization #41

Closed sangaline closed 6 years ago

sangaline commented 6 years ago

Safari serializes async arrow functions to

async function (variable) => { // code }

which is invalid. This only happens for the outermost function, so it should be relatively easy to add special handling for this case. We should also report this to Safari, it seems to be in violation of the ECMA spec:

If the object was defined using ECMAScript code and the returned string representation is not in the form of a MethodDefinition or GeneratorMethod then the representation must be such that if the string is evaluated, using eval in a lexical context that is equivalent to the lexical context used to create the original object, it will result in a new functionally equivalent object.