diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2015-11-10 12:54:02 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2015-11-10 12:54:02 +0800 |
commit | ff29bf81f852941cd7bcef1c051c77eccd4857bc (patch) | |
tree | 46b3985f9dbc2544c6905ed35a87c93f8ba71140 /test/test_jsinterp.py | |
parent | b25f7533975d7463cc772e9d106802ef29252796 (diff) |
[jsinterp] Support alternative function definition form
Diffstat (limited to 'test/test_jsinterp.py')
-rw-r--r-- | test/test_jsinterp.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index fc73e5dc2..63c350b8f 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -19,6 +19,9 @@ class TestJSInterpreter(unittest.TestCase): jsi = JSInterpreter('function x3(){return 42;}') self.assertEqual(jsi.call_function('x3'), 42) + jsi = JSInterpreter('var x5 = function(){return 42;}') + self.assertEqual(jsi.call_function('x5'), 42) + def test_calc(self): jsi = JSInterpreter('function x4(a){return 2*a+1;}') self.assertEqual(jsi.call_function('x4', 3), 7) |