src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/MapCreator.java

Print this page




 135         }
 136 
 137         // See ECMA 5.1 10.5 Declaration Binding Instantiation.
 138         // Step 2  If code is eval code, then let configurableBindings
 139         // be true else let configurableBindings be false.
 140         // We have to make vars, functions declared in 'eval' code
 141         // configurable. But vars, functions from any other code is
 142         // not configurable.
 143         if (symbol.isScope() && !evalCode) {
 144             flags |= Property.NOT_CONFIGURABLE;
 145         }
 146 
 147         if (symbol.isFunctionDeclaration()) {
 148             flags |= Property.IS_FUNCTION_DECLARATION;
 149         }
 150 
 151         if (symbol.isConst()) {
 152             flags |= Property.NOT_WRITABLE;
 153         }
 154 




 155         // Mark symbol as needing declaration. Access before declaration will throw a ReferenceError.
 156         if (symbol.isBlockScoped() && symbol.isScope()) {
 157             flags |= Property.NEEDS_DECLARATION;
 158         }
 159 
 160         return flags;
 161     }
 162 }


 135         }
 136 
 137         // See ECMA 5.1 10.5 Declaration Binding Instantiation.
 138         // Step 2  If code is eval code, then let configurableBindings
 139         // be true else let configurableBindings be false.
 140         // We have to make vars, functions declared in 'eval' code
 141         // configurable. But vars, functions from any other code is
 142         // not configurable.
 143         if (symbol.isScope() && !evalCode) {
 144             flags |= Property.NOT_CONFIGURABLE;
 145         }
 146 
 147         if (symbol.isFunctionDeclaration()) {
 148             flags |= Property.IS_FUNCTION_DECLARATION;
 149         }
 150 
 151         if (symbol.isConst()) {
 152             flags |= Property.NOT_WRITABLE;
 153         }
 154 
 155         if (symbol.isBlockScoped()) {
 156             flags |= Property.IS_LEXICAL_BINDING;
 157         }
 158 
 159         // Mark symbol as needing declaration. Access before declaration will throw a ReferenceError.
 160         if (symbol.isBlockScoped() && symbol.isScope()) {
 161             flags |= Property.NEEDS_DECLARATION;
 162         }
 163 
 164         return flags;
 165     }
 166 }