Permalink
Browse files

need to do the same to __tame_k too

  • Loading branch information...
1 parent ea9b905 commit 5523e40a6bf249006a596cfb8e705a134bf70ca5 @maxtaco committed with Jan 9, 2012
Showing with 27 additions and 10 deletions.
  1. +13 −6 lib/coffee-script/nodes.js
  2. +14 −4 src/nodes.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -2342,10 +2342,16 @@ exports.TameRequire = class TameRequire extends Base
else
"inline"
+ window_mode = false
+ window_val = null
+
inc = null
inc = switch (v)
when "inline", "window"
- InlineDeferral.generate(if v is "window" then v else null)
+ window_mode = true if v is "window"
+ if window_mode
+ window_val = new Value new Literal v
+ InlineDeferral.generate(window_val.copy())
when "node"
file = new Literal "'coffee-script'"
access = new Access new Literal tame.const.ns
@@ -2362,8 +2368,13 @@ exports.TameRequire = class TameRequire extends Base
rhs = new Code [], new Block []
lhs = new Value new Literal tame.const.k
+ if window_val
+ window_val.add new Access lhs
+ lhs = window_val
k = new Assign lhs, rhs
+
+
out + "#{@tab}" + k.compile(o, LEVEL_TOP)
children = [ 'typ']
@@ -2965,9 +2976,8 @@ InlineDeferral =
cn = new Value new Literal tame.const.Deferrals
ns = new Value new Literal tame.const.ns
if ns_window # window.tame = ...
- ns_window_val = new Value new Literal ns_window
- ns_window_val.add new Access ns
- ns = ns_window_val
+ ns_window.add new Access ns
+ ns = ns_window
# make the constructor:
#

0 comments on commit 5523e40

Please sign in to comment.