Package org.mozilla.javascript

Examples of org.mozilla.javascript.WrappedException


        public void put(String name, Scriptable start, Object value) {
            //Allow setting values to existing variables, or if this is a
            //java class (used by importClass & importPackage)
            if (this.locked && !has(name, start) && !(value instanceof NativeJavaClass) && !(value instanceof Function)) {
                // Need to wrap into a runtime exception as Scriptable.put has no throws clause...
                throw new WrappedException (new JavaScriptException("Implicit declaration of global variable '" + name +
                  "' forbidden. Please ensure all variables are explicitely declared with the 'var' keyword"));
            }
            this.useSession = true;
            super.put(name, start, value);
        }
View Full Code Here


        }

        public void put(int index, Scriptable start, Object value) {
            // FIXME(SW): do indexed properties have a meaning on the global scope?
            if (this.locked && !has(index, start)) {
                throw new WrappedException(new JavaScriptException("Global scope locked. Cannot set value for index " + index));
            }
            this.useSession = true;
            super.put(index, start, value);
        }
View Full Code Here

            } catch (JavaScriptException e) {
                // the only simple solution is to forward it as a
                // RuntimeException to be catched by event dispatching
                // in BridgeEventSupport.java
                // another solution will to give UserAgent to interpreters
                throw new WrappedException(e);
            }
        }
View Full Code Here

            } catch (JavaScriptException e) {
                // the only simple solution is to forward it as a
                // RuntimeException to be catched by event dispatching
                // in BridgeEventSupport.java
                // another solution will to give UserAgent to interpreters
                throw new WrappedException(e);
            }
        }
View Full Code Here

         */
        public void run() {
            try {
                interpreter.callHandler(function, arguments);
            } catch (JavaScriptException e) {
                throw new WrappedException(e);
            }
        }
View Full Code Here

                                           Context.toObject(content, scope));
                                }
                                arguments[0] = so;
                                return arguments;
                            } catch (IOException e) {
                                throw new WrappedException(e);
                            } catch (InterpreterException e) {
                                throw new WrappedException(e);
                            }
                        }
                    });
            } catch (JavaScriptException e) {
                throw new WrappedException(e);
            }
        }
View Full Code Here

                             return arguments;
                         }
                     });
            } catch (JavaScriptException e) {
                Context.exit();
                throw new WrappedException(e);
            }
        }
View Full Code Here

        public void put(String name, Scriptable start, Object value) {
            //Allow setting values to existing variables, or if this is a
            //java class (used by importClass & importPackage)
            if (this.locked && !has(name, start) && !(value instanceof NativeJavaClass)) {
                // Need to wrap into a runtime exception as Scriptable.put has no throws clause...
                throw new WrappedException (new JavaScriptException("Implicit declaration of global variable '" + name +
                  "' forbidden. Please ensure all variables are explicitely declared with the 'var' keyword"));
            }
            this.useSession = true;
            super.put(name, start, value);
        }
View Full Code Here

        }

        public void put(int index, Scriptable start, Object value) {
            // FIXME(SW): do indexed properties have a meaning on the global scope?
            if (this.locked && !has(index, start)) {
                throw new WrappedException(new JavaScriptException("Global scope locked. Cannot set value for index " + index));
            }
            this.useSession = true;
            super.put(index, start, value);
        }
View Full Code Here

          sb.append(" ");
        sb.append("^\n");
      }
    }
    if(e instanceof WrappedException) {
      WrappedException wrapped = (WrappedException) e;
      Throwable ex = wrapped.getWrappedException();
      for(StackTraceElement el: ex.getStackTrace()) {
        sb.append("\tat ");
        sb.append(el);
        sb.append("\n");
View Full Code Here

TOP

Related Classes of org.mozilla.javascript.WrappedException

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.