]> code.delx.au - gnu-emacs-elpa/commitdiff
Add test on shorthand method name and scoping
authorCarl Lei <xecycle@gmail.com>
Thu, 15 Oct 2015 11:55:32 +0000 (19:55 +0800)
committerCarl Lei <xecycle@gmail.com>
Thu, 29 Oct 2015 00:59:11 +0000 (08:59 +0800)
tests/parser.el

index 17519cab5cbdfac10d5ea809dbe622612e964cfb..650bac813084433cfa8f07e1fa36ddacc966cfbd 100644 (file)
@@ -189,6 +189,11 @@ the test."
 (js2-deftest-parse object-literal-method
   "var x = {f(y) {  return y;\n}};")
 
+(js2-deftest object-literal-method-own-name-in-scope "({f(){f();}});"
+  (js2-mode)
+  (should (equal '("msg.undeclared.variable" "f")
+                 (caar js2-parsed-warnings))))
+
 (js2-deftest-parse object-literal-getter-method
   "var x = {get f() {  return 42;\n}};")