You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If so, in my opinion, I don't think we need to do that in order to remain compliant with the spec.
My reading of the passage you linked to is that:
It describes the Directive Prologue as a thing which a parser needs to recognise.
It describes what code comprises the Directive Prologue.
It states that the engine needs to identify a Use Strict Directive within the Prologue, and process code within the function as strict mode code.
But what it doesn't say is how the Directive Prologue needs to be stored internally in the engine. All it says is:
A Use Strict Directive is an ExpressionStatement in a Directive Prologue
So I think we are compliant. FunctionBody::directivesis the Directive Prologue, and we store directives in it. The spec doesn't say that directives also need to be stored elsewhere.
OK, we're storing directives as Directive rather than ExpressionStatement. But there seems little point in using ExpressionStatement(Expression(StringLiteral)) since the expression is statically known to be a StringLiteral.
Sorry if I've completely misinterpreted what you're saying and have got confused!
https://tc39.es/ecma262/#directive-prologue
Oxc AST does not conformance to this definition.
Oxc produces
it should be at least
The text was updated successfully, but these errors were encountered: