-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes estree/estree#6 #99
Conversation
This picks up @dherman [earlier commit](dherman@70ba4ab) where it left off. Also attempted to addres @michaelficarra's concern about raw string source's being wrapped with quotes.
} | ||
``` | ||
|
||
The body of a function, which is a block statement that may contain a directive prologue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Directive Prologue is always present (but sometimes empty). Perhaps "… a block statement that may begin with directives"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could put separate array directives
in front of body
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same for Program
node)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could put separate array
directives
in front ofbody
.
That would either remove directives from body
(which breaks backwards compatibility) or reference them twice (which is not JSON-friendly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comment about interface Directive
below - it already breaks backward compatibility!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does inheriting from ExpressionStatement
to add a property without changing anything else (including type
) break backwards compatibility?
|
||
A directive from the directive prologue of a script or function. | ||
The `directive` property is the raw string source of the directive. | ||
This value includes single or double wrapping quotes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think quotes should be included in the value. "use strict"
and 'use strict'
should yield identical ASTs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. They're insignificant.
This picks up @dherman's earlier commit where it left off.
Also attempted to addres @michaelficarra's concern about raw string source's being wrapped with quotes.