This adds support for applying overlapping patches to the same AST witho... #4

Merged
merged 1 commit into from Apr 23, 2012

2 participants

@oyvindkinsey

...ut having to do multiple passes on the entire file.

@oyvindkinsey oyvindkinsey This adds support for applying overlapping patches to the same AST wi…
…thout having to do multiple passes on the entire file.
a42b831
@CGamesPlay

I'm nervous about the performance trade-off this has, but it's a good change for now. Also, really need test coverage on the jspatch code :-X

@CGamesPlay CGamesPlay merged commit a1f0d72 into facebookarchive:master Apr 23, 2012
@oyvindkinsey

Unfortunately it's currently the only way to make a pass of jspatch consistent - without this there's no guarantee that every patch in the patchfile will be applied to the source.

Of course, the optimal solution would be to only properly keep track of the modified segments so at to allow overlapping change sets.

Alternatively a separate mode where the AST is modified freely and then compiled back in to js.

@CGamesPlay

Oh, and of course this change means that jspatch might not terminate (without crashing) :)

Either of the proposed solutions is better. We can deal with it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment