On 2015/02/26 07:52:07, rossberg wrote:
LGTM
https://codereview.chromium.org/948303004/diff/1/src/ast.h
File src/ast.h (right):
https://codereview.chromium.org/948303004/diff/1/src/ast.h#newcode613
src/ast.h:613: const AstRawString* module_specifier() const { return
module_specifier_; }
On 2015/02/25 21:43:12, adamk wrote:
> On 2015/02/25 16:07:25, arv wrote:
> > On 2015/02/25 13:55:49, rossberg wrote:
> > > Hm, is it necessary that the specifier is duplicated on every
importdecl
> node?
> > > That doesn't make sense from an AST perspective, and the fact that
you
then
> > need
> > > a setter doesn't make it better.
> >
> > At the moment the actual import statement is not represented in the
AST so
> then
> > I see why this is needed. I think this approach is fine (at least for
now).
>
> I'm open to other suggestions, but I don't think it will be clear until
I
get
> further along what the right organization for this data will be, which
is
why
I
> went with this for now, basically a desugaring of
>
> import {x, y} from "m.js"; -> import {x} from "m.js"; import {y} from
"m.js";
But is this an adequate desugaring? Wouldn't those two forms have somewhat
different interactions with the loader, which might be observable if you
customise it?
I believe it is a proper desugaring, see
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-hostresolveimportedmodule
(tl;dr: "This operation must be idempotent if it completes normally. Each
time
it is called with a specific referencingModule, specifier pair as arguments
it
must return the same Module Record instance.").
I admit that it might be a challenge to ensure this invariant in a
customized
loader, but that's a challenge for the Loader spec.
Maybe it's fine, if this program equivalence actually holds. But keep in
mind
that the AST is a rather specific abstraction, not just organising some
data.
Can you expand on what you mean here? It's not as if V8's AST is one-to-one
mappable to the grammar productions in the spec.
https://codereview.chromium.org/948303004/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.