src/jdk/nashorn/internal/codegen/CompilerConstants.java
Print this page
rev 738 : 8030182: scopeCall with -1 as line number
Reviewed-by: hannesw, jlaskey
rev 739 : 8030809: Anonymous functions should not be shown with internal names in script stack trace
Reviewed-by: lagergren, hannesw, jlaskey
*** 39,48 ****
--- 39,49 ----
* This class represents constant names of variables, methods and fields in
* the compiler
*/
public enum CompilerConstants {
+
/** the __FILE__ variable */
__FILE__,
/** the __DIR__ variable */
__DIR__,
*** 73,83 ****
/** default script name */
DEFAULT_SCRIPT_NAME("Script"),
/** function prefix for anonymous functions */
! FUNCTION_PREFIX("function$"),
/** method name for Java method that is script entry point */
RUN_SCRIPT("runScript"),
/**
--- 74,84 ----
/** default script name */
DEFAULT_SCRIPT_NAME("Script"),
/** function prefix for anonymous functions */
! ANON_FUNCTION_PREFIX("L:"),
/** method name for Java method that is script entry point */
RUN_SCRIPT("runScript"),
/**
*** 147,176 ****
/** name for allocate method in JO objects */
ALLOCATE("allocate"),
/** prefix for split methods, @see Splitter */
! SPLIT_PREFIX("$split"),
/** prefix for split array method and slot */
! SPLIT_ARRAY_ARG("split_array", 3),
/** get string from constant pool */
! GET_STRING("$getString"),
/** get map */
! GET_MAP("$getMap"),
/** get map */
! SET_MAP("$setMap"),
/** get array prefix */
! GET_ARRAY_PREFIX("$get"),
/** get array suffix */
GET_ARRAY_SUFFIX("$array");
private final String symbolName;
private final Class<?> type;
private final int slot;
private CompilerConstants() {
--- 148,182 ----
/** name for allocate method in JO objects */
ALLOCATE("allocate"),
/** prefix for split methods, @see Splitter */
! SPLIT_PREFIX(":split"),
/** prefix for split array method and slot */
! SPLIT_ARRAY_ARG(":split_array", 3),
/** get string from constant pool */
! GET_STRING(":getString"),
/** get map */
! GET_MAP(":getMap"),
/** get map */
! SET_MAP(":setMap"),
/** get array prefix */
! GET_ARRAY_PREFIX(":get"),
/** get array suffix */
GET_ARRAY_SUFFIX("$array");
+ /**
+ * Prefix used for internal methods generated in script clases.
+ */
+ public static final String INTERNAL_METHOD_PREFIX = ":";
+
private final String symbolName;
private final Class<?> type;
private final int slot;
private CompilerConstants() {