Package booton.live

Examples of booton.live.Source


        } catch (AssertionError e) {
            throw e; // rethrow assertion error
        } catch (ScriptException e) {
            dumpCode(source);

            Source code = new Source(source.getSimpleName(), Javascript.getScript(source).write());
            TranslationError error = new TranslationError(e);
            error.write(code.findBlock(e.getFailingLineNumber()));

            throw error;
        } catch (Throwable e) {
            dumpCode(source);
View Full Code Here


                return null; // success
            } else {
                // fail (AssertionError) or error

                // decode as Java's error and rethrow it
                Source code = new Source(sourceName, compiled.length() != 0 ? compiled : script.write());
                Throwable throwable = ClientStackTrace.decode((String) result, code);

                if (throwable instanceof AssertionError || throwable instanceof InternalError) {
                    dumpCode(code);

                    throwable = new PowerAssertOffError(throwable);
                }
                throw I.quiet(throwable);
            }
        } catch (ScriptException e) {
            dumpCode(source);
            // script parse error (translation fails) or runtime error
            Source code = new Source(sourceName, script.write());

            if (e.getScriptSourceCode() == null) {
                Throwable cause = e.getCause();

                if (cause instanceof EcmaError) {
                    throw new ScriptRuntimeError(code, (EcmaError) cause);
                } else {
                    // error in boot.js
                    int number = e.getFailingLineNumber();

                    if (number != -1) {
                        TranslationError error = new TranslationError(e);
                        error.write(code.findBlock(number));
                        throw error;
                    } else {
                        throw I.quiet(e);
                    }
                }
            } else {
                // error in test script
                TranslationError error = new TranslationError(e);
                error.write(code.findBlock(e.getFailingLineNumber()));
                throw error;
            }
        } catch (Throwable e) {
            throw I.quiet(e);
        }
View Full Code Here

TOP

Related Classes of booton.live.Source

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.