Tabnine Logo
EcmaError.getName
Code IndexAdd Tabnine to your IDE (free)

How to use
getName
method
in
org.mozilla.javascript.EcmaError

Best Java code snippets using org.mozilla.javascript.EcmaError.getName (Showing top 11 results out of 315)

origin: com.github.tntim96/rhino

static boolean accept(Object nameObj) {
  String name;
  try {
    name = ScriptRuntime.toString(nameObj);
  } catch (EcmaError ee) {
    if ("TypeError".equals(ee.getName())) {
      return false;
    }
    throw ee;
  }
  // See http://w3.org/TR/xml-names11/#NT-NCName
  int length = name.length();
  if (length != 0) {
    if (isNCNameStartChar(name.charAt(0))) {
      for (int i = 1; i != length; ++i) {
        if (!isNCNameChar(name.charAt(i))) {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}
origin: com.sun.phobos/phobos-rhino

static boolean accept(Object nameObj) {
  String name;
  try {
    name = ScriptRuntime.toString(nameObj);
  } catch (EcmaError ee) {
    if ("TypeError".equals(ee.getName())) {
      return false;
    }
    throw ee;
  }
  
  // See http://w3.org/TR/xml-names11/#NT-NCName
  int length = name.length();
  if (length != 0) {
    if (isNCNameStartChar(name.charAt(0))) {
      for (int i = 1; i != length; ++i) {
        if (!isNCNameChar(name.charAt(i))) {
          return false;
        }
      }
      return true;
    }
  }
  
  return false;
}

origin: com.github.tntim96/rhino

/**
 * See E4X 13.1.2.1.
 */
public boolean isXMLName(Context cx, Object nameObj)
{
  String name;
  try {
    name = ScriptRuntime.toString(nameObj);
  } catch (EcmaError ee) {
    if ("TypeError".equals(ee.getName())) {
      return false;
    }
    throw ee;
  }
  // See http://w3.org/TR/xml-names11/#NT-NCName
  int length = name.length();
  if (length != 0) {
    if (isNCNameStartChar(name.charAt(0))) {
      for (int i = 1; i != length; ++i) {
        if (!isNCNameChar(name.charAt(i))) {
          return false;
        }
      }
      return true;
    }
  }
  return false;
}
origin: org.apache.cocoon/cocoon-flowscript-impl

  public Location getLocation(Object obj, String description) {
    if (obj instanceof EcmaError) {
      EcmaError ex = (EcmaError)obj;
      if (ex.sourceName() != null) {
        return new LocationImpl(ex.getName(), ex.sourceName(), ex.lineNumber(), ex.columnNumber());
      } else {
        return Location.UNKNOWN;
      }

    } else if (obj instanceof JavaScriptException) {
      JavaScriptException ex = (JavaScriptException)obj;
      if (ex.sourceName() != null) {
        return new LocationImpl(description, ex.sourceName(), ex.lineNumber(), -1);
      } else {
        return Location.UNKNOWN;
      }
    }
    
    return null;
  } 
};
origin: geogebra/geogebra

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: com.github.tntim96/rhino

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: io.apigee/rhino

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: ro.isdc.wro4j/rhino

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: com.sun.phobos/phobos-rhino

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: rhino/js

  EcmaError ee = (EcmaError)t;
  re = ee;
  errorName = ee.getName();
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
origin: geogebra/geogebra

  EcmaError ee = (EcmaError)t;
  re = ee;
  type = TopLevel.NativeErrors.valueOf(ee.getName());
  errorMsg = ee.getErrorMessage();
} else if (t instanceof WrappedException) {
org.mozilla.javascriptEcmaErrorgetName

Javadoc

Gets the name of the error. ECMA edition 3 defines the following errors: EvalError, RangeError, ReferenceError, SyntaxError, TypeError, and URIError. Additional error names may be added in the future. See ECMA edition 3, 15.11.7.9.

Popular methods of EcmaError

  • lineNumber
  • sourceName
  • columnNumber
  • getErrorMessage
    Gets the message corresponding to the error. See ECMA edition 3, 15.11.7.10.
  • <init>
  • lineSource
  • recordErrorOrigin
  • getMessage
  • details
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • startActivity (Activity)
  • Kernel (java.awt.image)
  • Path (java.nio.file)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now