-
Notifications
You must be signed in to change notification settings - Fork 185
Conversation
I'm not sure I like the idea of coupling |
Regarding the last comment here, I can't tell if you mean "I don't like System to own Absent the spec, would you consider this new split between System and Loader a better design? I would, because the concerns of the Loader are now entirely focused on linking and no other issue. For module linking, As to your concern that this function may perceived as part of the spec, as far as I can tell the spec does not prohibit this kind of extension. Let's consider the two possibilities: 1) one or more downstream consumers of this Loader uses the I suppose we could make the API "you must monkey patch Does this convince you? |
Thanks this looks great. The issue with making parse a spec function is it means opening up the parse tree to be something that is specified. We get around returning the syntax tree directly here through the System.register implementation which simply sets a When considered from the spec perspective, the parse tree is actually stored under That's why I was suggesting something like: Loader.parse = ... So that it can both be a private API, and coupled to the loader. |
With this PR we should also put some thought to #171. These global overwrites need to be given a little careful attention. |
As far as I can tell from reading the spec, [[Body]] is an opaque typed property, created by parsing and consumed by evaluate. In 15.2.6.2 EnsureEvaluated(mod, seen, loader) Abstract Operation:
So the spec need make no rules about the content of [[Body]], only that it is set on to Currently we are parsing and compiling to a function object passed on |
PTAL |
Alright, this seems great. It would be nice to have some docs on parse and register but I'll be sure this is updated in due course as well. Can we rebase? |
This allows Loader to be independent of compiler/transcoder and it allows the System to control parse options w/o consulting Loader.
I guess you meant "Can you squash the commits"? Anyway that is what I did. |
Lift Loader.parse into System.parse.
This allows Loader to be independent of compiler/transcoder and
it allows the System to control parse options w/o consulting Loader.