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

Print this page




  45 
  46     /** message property in instance */
  47     @Property(name = NativeError.MESSAGE)
  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     // initialized by nasgen
  59     private static PropertyMap $nasgenmap$;
  60 
  61     static PropertyMap getInitialMap() {
  62         return $nasgenmap$;
  63     }
  64 

  65     NativeTypeError(final Object msg, final Global global) {
  66         super(global.getTypeErrorPrototype(), global.getTypeErrorMap());
  67         if (msg != UNDEFINED) {
  68             this.instMessage = JSType.toString(msg);
  69         } else {
  70             delete(NativeError.MESSAGE, false);
  71         }

  72     }
  73 
  74     private NativeTypeError(final Object msg) {
  75         this(msg, Global.instance());
  76     }
  77 
  78     @Override
  79     public String getClassName() {
  80         return "Error";
  81     }
  82 
  83     /**
  84      * ECMA 15.11.6.5 TypeError
  85      *
  86      * Constructor
  87      *
  88      * @param newObj was this error instantiated with the new operator
  89      * @param self   self reference
  90      * @param msg    error message
  91      *


  45 
  46     /** message property in instance */
  47     @Property(name = NativeError.MESSAGE)
  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     // initialized by nasgen
  59     private static PropertyMap $nasgenmap$;
  60 
  61     static PropertyMap getInitialMap() {
  62         return $nasgenmap$;
  63     }
  64 
  65     @SuppressWarnings("LeakingThisInConstructor")
  66     NativeTypeError(final Object msg, final Global global) {
  67         super(global.getTypeErrorPrototype(), global.getTypeErrorMap());
  68         if (msg != UNDEFINED) {
  69             this.instMessage = JSType.toString(msg);
  70         } else {
  71             delete(NativeError.MESSAGE, false);
  72         }
  73         NativeError.initException(this);
  74     }
  75 
  76     private NativeTypeError(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.5 TypeError
  87      *
  88      * Constructor
  89      *
  90      * @param newObj was this error instantiated with the new operator
  91      * @param self   self reference
  92      * @param msg    error message
  93      *