]> git.kaiwu.me - njs.git/commitdiff
Added extra tests for assignment expression.
authorDmitry Volyntsev <xeioex@nginx.com>
Sun, 28 Apr 2019 11:56:33 +0000 (14:56 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Sun, 28 Apr 2019 11:56:33 +0000 (14:56 +0300)
This closes #52 issue on Github.

njs/test/njs_unit_test.c

index 4640996cad3641635b2da43fcca15c9a4cec847c..e8b23e9cfff36eb7846dd6b3c6ba0bed9700e63a 100644 (file)
@@ -4975,6 +4975,14 @@ static njs_unit_test_t  njs_test[] =
                  "          valueOf: function() { return 1 } };  a"),
       nxt_string("1") },
 
+    { nxt_string("var a = { toString: function() { return [] },"
+                 "          valueOf: function() { return 1 } };"
+                 "var o = {}; o[a] = 'test'"),
+      nxt_string("test") },
+
+    { nxt_string("({})[{}] = 'test'"),
+      nxt_string("test") },
+
     { nxt_string("var o = {b:$r.props.b}; o.b"),
       nxt_string("42") },