pulumi/sdk/nodejs/runtime
Joe Duffy 69f5882b97
Fix two closure bugs (#664)
This fixes two closure bugs.

First, we had special cased `__awaiter` from days of yore, when we had
special cased its capture.  I also think we were confused at some point
and instead of fixing the fact that we captured `this` for non-arrow
functions, which `__awaiter` would trigger, we doubled down on this
incorrect hack.  This means we missed a real bonafide `this` capture.

Second, we had a global cache of captured variable objects.  So, if a
free variable resolved to the same JavaScript object, it always resolved
to the first serialization of that object.  This is clearly wrong if
the object had been mutated in the meantime.  The cache is required to
reach a fixed point during mutually recursive captures, but we should
only be using it for the duration of a single closure serialization
call.  That's precisely what this commit does.

Also add a fix for this case.

This fixes pulumi/pulumi#663.
2017-12-07 16:21:28 -08:00
..
native Fix two closure bugs (#664) 2017-12-07 16:21:28 -08:00
closure.ts Fix two closure bugs (#664) 2017-12-07 16:21:28 -08:00
config.ts Enable tslinting of the nodejs sdk. (#433) 2017-10-18 15:03:56 -07:00
debuggable.ts Add accessors to fetch the Pulumi project and stack names 2017-10-19 08:26:57 -07:00
index.ts Merge root stack changes with parenting 2017-11-26 08:14:01 -08:00
invoke.ts Switch to parent pointers; display components nicely 2017-11-26 08:14:01 -08:00
langhost.ts Add a manifest to checkpoint files (#630) 2017-12-01 13:50:32 -08:00
resource.ts Simplify RPC changes 2017-11-29 12:08:01 -08:00
rpc.ts Improve promise leak diagnostics (#508) 2017-10-31 07:48:59 -07:00
settings.ts Make root resources more general 2017-11-26 12:01:13 -08:00
stack.ts Simplify RPC changes 2017-11-29 12:08:01 -08:00