Sha256: b89bf5a14e1c3879cbe1d3e5f73cd8e8f4b0877e01b5fe8ba16dc74cc42f0651

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

# Ensure that we don't wrap Nodes that are "statement_only" in a closure.

items: [1, 2, 3, "bacon", 4, 5]

for item in items
  break if item is "bacon"

findit: (items) ->
  for item in items
    return item if item is "bacon"

ok findit(items) is "bacon"


# When when a closure wrapper is generated for expression conversion, make sure
# that references to "this" within the wrapper are safely converted as well.

obj: {
  num: 5
  func: ->
    this.result: if false
      10
    else
      "a"
      "b"
      this.num
}

ok obj.num is obj.func()
ok obj.num is obj.result

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
haml-more-0.5.1 vendor/coffee-script/test/test_expressions.coffee
haml-more-0.5.0 vendor/coffee-script/test/test_expressions.coffee
haml-more-0.4.0 vendor/coffee-script/test/test_expressions.coffee
haml-more-0.4.0.d vendor/coffee-script/test/test_expressions.coffee
haml-more-0.4.0.c vendor/coffee-script/test/test_expressions.coffee
haml-more-0.4.0.b vendor/coffee-script/test/test_expressions.coffee
haml-more-0.4.0.a vendor/coffee-script/test/test_expressions.coffee