src/jdk/nashorn/internal/objects/NativeSyntaxError.java

Print this page




  45 
  46     /** message property in instance */
  47     @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
  48     public Object instMessage;
  49 
  50     /** error name property */
  51     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
  52     public Object name;
  53 
  54     /** ECMA 15.1.1.1 message property */
  55     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
  56     public Object message;
  57 
  58     /** Nashorn extension: underlying exception */
  59     @Property(attributes = Attribute.NOT_ENUMERABLE)
  60     public Object nashornException;
  61 
  62     // initialized by nasgen
  63     private static PropertyMap $nasgenmap$;
  64 
  65     static PropertyMap getInitialMap() {
  66         return $nasgenmap$;
  67     }
  68 
  69     @SuppressWarnings("LeakingThisInConstructor")
  70     NativeSyntaxError(final Object msg, final Global global) {
  71         super(global.getSyntaxErrorPrototype(), getInitialMap());
  72         if (msg != UNDEFINED) {
  73             this.instMessage = JSType.toString(msg);
  74         } else {
  75             this.delete(NativeError.MESSAGE, false);
  76         }
  77         NativeError.initException(this);
  78     }
  79 
  80     private NativeSyntaxError(final Object msg) {
  81         this(msg, Global.instance());
  82     }
  83 
  84     @Override
  85     public String getClassName() {
  86         return "Error";
  87     }
  88 
  89     /**
  90      * ECMA 15.11.6.4 SyntaxError
  91      *


  45 
  46     /** message property in instance */
  47     @Property(name = NativeError.MESSAGE, attributes = Attribute.NOT_ENUMERABLE)
  48     public Object instMessage;
  49 
  50     /** error name property */
  51     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
  52     public Object name;
  53 
  54     /** ECMA 15.1.1.1 message property */
  55     @Property(attributes = Attribute.NOT_ENUMERABLE, where = Where.PROTOTYPE)
  56     public Object message;
  57 
  58     /** Nashorn extension: underlying exception */
  59     @Property(attributes = Attribute.NOT_ENUMERABLE)
  60     public Object nashornException;
  61 
  62     // initialized by nasgen
  63     private static PropertyMap $nasgenmap$;
  64 




  65     @SuppressWarnings("LeakingThisInConstructor")
  66     NativeSyntaxError(final Object msg, final Global global) {
  67         super(global.getSyntaxErrorPrototype(), $nasgenmap$);
  68         if (msg != UNDEFINED) {
  69             this.instMessage = JSType.toString(msg);
  70         } else {
  71             this.delete(NativeError.MESSAGE, false);
  72         }
  73         NativeError.initException(this);
  74     }
  75 
  76     private NativeSyntaxError(final Object msg) {
  77         this(msg, Global.instance());
  78     }
  79 
  80     @Override
  81     public String getClassName() {
  82         return "Error";
  83     }
  84 
  85     /**
  86      * ECMA 15.11.6.4 SyntaxError
  87      *