Package org.auraframework.util.javascript

Examples of org.auraframework.util.javascript.JavascriptProcessingError


        JsonStreamReader jreader = new JsonStreamReader(sourceCode);
        jreader.setRecursiveReadEnabled(false);
        // skip comment and whitespace
        JsonConstant token = jreader.next();
        int lineOffset = 0;
        JavascriptProcessingError customError = null;
        if (token == JsonConstant.OBJECT_START) {
            // fix, but report a ValidationError also
            int charNum = jreader.getCharNum();
            sourceCode = "var actions=\n" + sourceCode.substring(charNum - 1);
            //
            // We do some fancy footwork here to get the line number right.
            // (1) we take off 1 to remove the (first line = 1) from the reader.
            // (2) we take off 1 for the '\n' just above in the fixup.
            // (3) we add back two when creating the error to make the line correct
            //     here while having the line offset adjusted correctly.
            // A little confusing, but it does do the right thing.
            //
            lineOffset = jreader.getLineNum() - 2;
            customError = new JavascriptProcessingError("Starting '(' missing", lineOffset + 2, 1,
                    sourceUrl,
                    null, Level.Error);
        }

        // TODO: reuse validators for optimization?
View Full Code Here


        }
        parsed = true;
    }

    private void addError(int lineNum, String message, String code) {
        JavascriptProcessingError e = new JavascriptProcessingError();
        e.setFilename(file.getName());
        e.setLine(lineNum);
        e.setStartColumn(0);
        e.setMessage(message);
        e.setEvidence(code);
        this.parseErrors.add(e);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.util.javascript.JavascriptProcessingError

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.