gt:         if (isRepresentableAsInt(number)) {
context: /*
   * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
   * particular file as subject to the "Classpath" exception as provided
   * by Oracle in the LICENSE file that accompanied this code.
   *
   * This code is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   * version 2 for more details (a copy is included in the LICENSE file that
   * accompanied this code).
   *
   * You should have received a copy of the GNU General Public License version
   * 2 along with this work; if not, write to the Free Software Foundation,
   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   *
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
  package jdk.nashorn.internal.runtime;
  
  import static jdk.nashorn.internal.codegen.CompilerConstants.staticCall;
  import static jdk.nashorn.internal.runtime.ECMAErrors.typeError;
  
  import java.lang.invoke.MethodHandle;
  import java.lang.invoke.MethodHandles;
  import java.lang.reflect.Array;
  import jdk.internal.dynalink.beans.StaticClass;
  import jdk.nashorn.api.scripting.JSObject;
  import jdk.nashorn.internal.codegen.CompilerConstants.Call;
  import jdk.nashorn.internal.parser.Lexer;
  import jdk.nashorn.internal.runtime.arrays.ArrayLikeIterator;
  import jdk.nashorn.internal.runtime.linker.Bootstrap;
  
  /**
   * Representation for ECMAScript types - this maps directly to the ECMA script standard
   */
  public enum JSType {
      /** The undefined type */
      UNDEFINED("undefined"),
  
      /** The null type */
      NULL("object"),
  
      /** The boolean type */
      BOOLEAN("boolean"),
  
      /** The number type */
      NUMBER("number"),
  
      /** The string type */
      STRING("string"),
  
      /** The object type */
      OBJECT("object"),
  
      /** The function type */
      FUNCTION("function");
  
      /** The type name as returned by ECMAScript "typeof" operator*/
      private final String typeName;
  
      /** Max value for an uint32 in JavaScript */
      public static final long MAX_UINT = 0xFFFF_FFFFL;
  
      private static final MethodHandles.Lookup myLookup = MethodHandles.lookup();
  
      /** JavaScript compliant conversion function from Object to boolean */
      public static final Call TO_BOOLEAN = staticCall(myLookup, JSType.class, "toBoolean", boolean.class, Object.class);
  
      /** JavaScript compliant conversion function from number to boolean */
      public static final Call TO_BOOLEAN_D = staticCall(myLookup, JSType.class, "toBoolean", boolean.class, double.class);
  
      /** JavaScript compliant conversion function from Object to integer */
      public static final Call TO_INTEGER = staticCall(myLookup, JSType.class, "toInteger", int.class, Object.class);
  
      /** JavaScript compliant conversion function from Object to long */
      public static final Call TO_LONG = staticCall(myLookup, JSType.class, "toLong", long.class, Object.class);
  
      /** JavaScript compliant conversion function from Object to number */
      public static final Call TO_NUMBER = staticCall(myLookup, JSType.class, "toNumber", double.class, Object.class);
  
      /** JavaScript compliant conversion function from Object to int32 */
      public static final Call TO_INT32 = staticCall(myLookup, JSType.class, "toInt32", int.class, Object.class);
  
      /** JavaScript compliant conversion function from double to int32 */
      public static final Call TO_INT32_D = staticCall(myLookup, JSType.class, "toInt32", int.class, double.class);
  
      /** JavaScript compliant conversion function from Object to uint32 */
      public static final Call TO_UINT32 = staticCall(myLookup, JSType.class, "toUint32", long.class, Object.class);
  
      /** JavaScript compliant conversion function from number to uint32 */
      public static final Call TO_UINT32_D = staticCall(myLookup, JSType.class, "toUint32", long.class, double.class);
  
      /** JavaScript compliant conversion function from Object to int64 */
      public static final Call TO_INT64 = staticCall(myLookup, JSType.class, "toInt64", long.class, Object.class);
  
      /** JavaScript compliant conversion function from number to int64 */
      public static final Call TO_INT64_D = staticCall(myLookup, JSType.class, "toInt64", long.class, double.class);
  
      /** JavaScript compliant conversion function from Object to String */
      public static final Call TO_STRING = staticCall(myLookup, JSType.class, "toString", String.class, Object.class);
  
      /** JavaScript compliant conversion function from number to String */
      public static final Call TO_STRING_D = staticCall(myLookup, JSType.class, "toString", String.class, double.class);
  
      /** JavaScript compliant conversion function from Object to primitive */
      public static final Call TO_PRIMITIVE = staticCall(myLookup, JSType.class, "toPrimitive", Object.class,  Object.class);
  
      private static final double INT32_LIMIT = 4294967296.0;
  
      /**
       * Constructor
       *
       * @param typeName the type name
       */
      private JSType(final String typeName) {
          this.typeName = typeName;
      }
  
      /**
       * The external type name as returned by ECMAScript "typeof" operator
       *
       * @return type name for this type
       */
      public final String typeName() {
          return this.typeName;
      }
  
      /**
       * Return the JSType for a given object
       *
       * @param obj an object
       *
       * @return the JSType for the object
       */
      public static JSType of(final Object obj) {
          // Order of these statements is tuned for performance (see JDK-8024476)
          if (obj == null) {
              return JSType.NULL;
          }
  
          if (obj instanceof ScriptObject) {
              return (obj instanceof ScriptFunction) ? JSType.FUNCTION : JSType.OBJECT;
          }
  
          if (obj instanceof Boolean) {
              return JSType.BOOLEAN;
          }
  
          if (obj instanceof String || obj instanceof ConsString) {
              return JSType.STRING;
          }
  
          if (obj instanceof Number) {
              return JSType.NUMBER;
          }
  
          if (obj == ScriptRuntime.UNDEFINED) {
              return JSType.UNDEFINED;
          }
  
          return Bootstrap.isCallable(obj) ? JSType.FUNCTION : JSType.OBJECT;
      }
  
      /**
       * Returns true if double number can be represented as an int
       *
       * @param number a long to inspect
       *
       * @return true for int representable longs
       */
      public static boolean isRepresentableAsInt(final long number) {
          return (int)number == number;
      }
  
      /**
       * Returns true if double number can be represented as an int
       *
       * @param number a double to inspect
       *
       * @return true for int representable doubles
       */
      public static boolean isRepresentableAsInt(final double number) {
          return (int)number == number;
      }
  
      /**
       * Returns true if double number can be represented as a long
       *
       * @param number a double to inspect
       * @return true for long representable doubles
       */
      public static boolean isRepresentableAsLong(final double number) {
          return (long)number == number;
      }
  
      /**
       * Get the smallest integer representation of a number. Returns an Integer
       * for something that is int representable, and Long for something that
       * is long representable. If the number needs to be a double, this is an
       * identity function
       *
       * @param number number to check
       *
       * @return Number instanceof the narrowest possible integer representation for number
       */
      public static Number narrowestIntegerRepresentation(final double number) {
  