8044803: Unnecessary restOf check
authorattila
Wed, 04 Jun 2014 16:52:50 +0200
changeset 24781 00f645e2d28a
parent 24780 747cf25884d6
child 24782 82c9c92e3733
8044803: Unnecessary restOf check Reviewed-by: hannesw, jlaskey
nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java
--- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jun 04 19:01:24 2014 +0530
+++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java	Wed Jun 04 16:52:50 2014 +0200
@@ -2423,7 +2423,7 @@
         }
 
         assert undefinedSymbol != null; //remove warning
-        if (undefinedSymbol == null || !undefinedSymbol.isScope()) {
+        if (!undefinedSymbol.isScope()) {
             return false; //disallow undefined as local var or parameter
         }
 
@@ -2440,11 +2440,6 @@
             return false;
         }
 
-        // TODO: why?
-        if (isRestOf()) {
-            return false;
-        }
-
         //make sure that undefined has not been overridden or scoped as a local var
         //between us and global
         if (!compiler.isGlobalSymbol(lc.getCurrentFunction(), "undefined")) {