nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java
changeset 23084 6c5c02d1023a
parent 21867 4e5ee0aeb468
equal deleted inserted replaced
23083:8c74590d5df1 23084:6c5c02d1023a
    66 
    66 
    67     static {
    67     static {
    68         final ArrayList<Property> properties = new ArrayList<>(2);
    68         final ArrayList<Property> properties = new ArrayList<>(2);
    69         properties.add(AccessorProperty.create("length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH));
    69         properties.add(AccessorProperty.create("length", Property.NOT_ENUMERABLE, G$LENGTH, S$LENGTH));
    70         properties.add(AccessorProperty.create("callee", Property.NOT_ENUMERABLE, G$CALLEE, S$CALLEE));
    70         properties.add(AccessorProperty.create("callee", Property.NOT_ENUMERABLE, G$CALLEE, S$CALLEE));
    71         map$ = PropertyMap.newMap(properties).setIsShared();
    71         map$ = PropertyMap.newMap(properties);
    72     }
    72     }
    73 
    73 
    74     static PropertyMap getInitialMap() {
    74     static PropertyMap getInitialMap() {
    75         return map$;
    75         return map$;
    76     }
    76     }
   265         // Strict functions won't always have a callee for arguments, and will pass null instead.
   265         // Strict functions won't always have a callee for arguments, and will pass null instead.
   266         final boolean isStrict = callee == null || callee.isStrict();
   266         final boolean isStrict = callee == null || callee.isStrict();
   267         final Global global = Global.instance();
   267         final Global global = Global.instance();
   268         final ScriptObject proto = global.getObjectPrototype();
   268         final ScriptObject proto = global.getObjectPrototype();
   269         if (isStrict) {
   269         if (isStrict) {
   270             return new NativeStrictArguments(arguments, numParams, proto, global.getStrictArgumentsMap());
   270             return new NativeStrictArguments(arguments, numParams, proto, NativeStrictArguments.getInitialMap());
   271         }
   271         }
   272         return new NativeArguments(arguments, callee, numParams, proto, global.getArgumentsMap());
   272         return new NativeArguments(arguments, callee, numParams, proto, NativeArguments.getInitialMap());
   273     }
   273     }
   274 
   274 
   275     /**
   275     /**
   276      * Length getter
   276      * Length getter
   277      * @param self self reference
   277      * @param self self reference