mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
#1534 class then "use strict" tests
This commit is contained in:
parent
8d952c245f
commit
80677a9d2b
1 changed files with 13 additions and 1 deletions
|
@ -618,4 +618,16 @@ test "#1980: regression with an inherited class with static function members", -
|
|||
class B extends A
|
||||
@static: => 'value'
|
||||
|
||||
eq B.static(), 'value'
|
||||
eq B.static(), 'value'
|
||||
|
||||
test "#1534: class then 'use strict'", ->
|
||||
# 'use strict' is only in effect if it's the first expression of a
|
||||
# function expression/declaration or Global code
|
||||
nonce = {}
|
||||
strictTest = 'do ->"use strict";arguments.callee'
|
||||
strictEnv = (try CoffeeScript.run strictTest, bare: yes catch e then nonce) is nonce
|
||||
return unless strictEnv
|
||||
throws (-> CoffeeScript.run "class then 'use strict';arguments.callee", bare: yes)
|
||||
doesNotThrow (-> CoffeeScript.run "class then arguments.callee", bare: yes)
|
||||
doesNotThrow (-> CoffeeScript.run 'class then arguments.callee;"use strict"', bare: yes)
|
||||
|
||||
|
|
Loading…
Reference in a new issue