diff options
author | Zahary Karadjov <zahary@gmail.com> | 2017-04-11 02:22:13 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2017-04-11 02:22:13 +0300 |
commit | 03770daba44fb9ac5c21729d0b32cda10f8767bd (patch) | |
tree | eb8c81da94064377cdd3678ef4bd5ef7c1386b92 /tests | |
parent | 54a1d9c16a9589dc60919311588a77e99fa83de5 (diff) | |
download | Nim-03770daba44fb9ac5c21729d0b32cda10f8767bd.tar.gz |
allow StmtLists to pass through semExprWithType
This fix was necessary in order to fix the lambda lifting used in the "jsffi" module, which relies on turning nkStmtList into nkLambda in a catch-all dot operator.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/js/tjsffi.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/js/tjsffi.nim b/tests/js/tjsffi.nim index 99a475a8e..e4aad4b99 100644 --- a/tests/js/tjsffi.nim +++ b/tests/js/tjsffi.nim @@ -21,6 +21,7 @@ true 12 Event { name: 'click: test' } Event { name: 'reloaded: test' } +Event { name: 'updates: test' } ''' """ @@ -295,7 +296,7 @@ block: """ function Event(name) { this.name = name; } function on(eventName, eventHandler) { eventHandler(new Event(eventName + ": test")); } - var jslib = { "on": on }; + var jslib = { "on": on, "subscribe": on }; """ .} @@ -311,3 +312,8 @@ block: jslib.on "reloaded" do: console.log jsarguments[0] + # this test case is different from the above, because + # `subscribe` is not overloaded in the current scope + jslib.subscribe "updates": + console.log jsarguments[0] + |