Package org.mozilla.javascript

Examples of org.mozilla.javascript.IdScriptableObject


            return new CompilerResult(compileCode(code, bare));
        } catch (StoppedContextException e) {
            return null; // Canceled
        } catch (JavaScriptException e) {
            if (e.getValue() instanceof IdScriptableObject) {
                IdScriptableObject error = (IdScriptableObject) e.getValue();
                String message = (String) ScriptableObject.getProperty(error, "message");
                IdScriptableObject location = (IdScriptableObject) ScriptableObject.getProperty(error, "location");
                Double line = (Double) ScriptableObject.getProperty(location, "first_line");
                Double column = (Double) ScriptableObject.getProperty(location, "first_column");
                return new CompilerResult(new Error(line == null ? -1 : line.intValue()+1, column == null ? 0 : column.intValue()+1, message, message));
            }
            return new CompilerResult(new Error(-1, "", e.getMessage()));
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.IdScriptableObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.