nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
changeset 24749 1549c85f8200
parent 24738 be2026c9717c
child 24753 675feda2f82d
equal deleted inserted replaced
24748:69787da7c664 24749:1549c85f8200
    83     public static final int NEEDS_CALLEE   = 1 << 3;
    83     public static final int NEEDS_CALLEE   = 1 << 3;
    84     /** Does this function make use of the this-object argument? */
    84     /** Does this function make use of the this-object argument? */
    85     public static final int USES_THIS      = 1 << 4;
    85     public static final int USES_THIS      = 1 << 4;
    86     /** Is this a variable arity function? */
    86     /** Is this a variable arity function? */
    87     public static final int IS_VARIABLE_ARITY = 1 << 5;
    87     public static final int IS_VARIABLE_ARITY = 1 << 5;
       
    88     /** Is this declared in a dynamic context */
       
    89     public static final int IN_DYNAMIC_CONTEXT = 1 << 6;
    88 
    90 
    89     /** Flag for strict or built-in functions */
    91     /** Flag for strict or built-in functions */
    90     public static final int IS_STRICT_OR_BUILTIN = IS_STRICT | IS_BUILTIN;
    92     public static final int IS_STRICT_OR_BUILTIN = IS_STRICT | IS_BUILTIN;
    91     /** Flag for built-in constructors */
    93     /** Flag for built-in constructors */
    92     public static final int IS_BUILTIN_CONSTRUCTOR = IS_BUILTIN | IS_CONSTRUCTOR;
    94     public static final int IS_BUILTIN_CONSTRUCTOR = IS_BUILTIN | IS_CONSTRUCTOR;
   746 
   748 
   747     static boolean isVarArg(final MethodType type) {
   749     static boolean isVarArg(final MethodType type) {
   748         return type.parameterType(type.parameterCount() - 1).isArray();
   750         return type.parameterType(type.parameterCount() - 1).isArray();
   749     }
   751     }
   750 
   752 
       
   753     /**
       
   754      * Is this ScriptFunction declared in a dynamic context
       
   755      * @return true if in dynamic context, false if not or irrelevant
       
   756      */
       
   757     public boolean inDynamicContext() {
       
   758         return false;
       
   759     }
       
   760 
   751     @SuppressWarnings("unused")
   761     @SuppressWarnings("unused")
   752     private static Object[] bindVarArgs(final Object[] array1, final Object[] array2) {
   762     private static Object[] bindVarArgs(final Object[] array1, final Object[] array2) {
   753         if (array2 == null) {
   763         if (array2 == null) {
   754             // Must clone it, as we can't allow the receiving method to alter the array
   764             // Must clone it, as we can't allow the receiving method to alter the array
   755             return array1.clone();
   765             return array1.clone();