/** * Returns the scope at a given index. * * @param index The index * @return The scope */ public Scope getScope(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object scope = null; try { scope = v8Object.executeObjectFunction(SCOPE, parameters); return new Scope(scope); } finally { parameters.close(); if (scope != null) { scope.close(); } } }
/** * Returns the underlying V8Object that represents this scope. * * @return The underlying V8Object that represents this scope. */ public ObjectMirror getScopeObject() { V8Object mirror = null; try { mirror = v8Object.executeObjectFunction(SCOPE_OBJECT, null); return (ObjectMirror) createMirror(mirror); } finally { if ( mirror != null ) { mirror.close(); } } }
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); scope.setVariableValue("z", 0); scope.close(); frame.close(); } });
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); ObjectMirror scopeObject = scope.getScopeObject(); String[] propertyNames = scopeObject.getPropertyNames(PropertyKind.Named, 0); result = propertyNames.length == 2; result = (Boolean) result && propertyNames[0].equals("z"); result = (Boolean) result && propertyNames[1].equals("k"); scopeObject.close(); scope.close(); frame.close(); } });
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope0 = frame.getScope(0); Scope scope1 = frame.getScope(1); result = (scope0 != null) && (scope1 != null); scope0.close(); scope1.close(); frame.close(); } });
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); scope.setVariableValue("z", 3.14); scope.close(); frame.close(); } });
/** * Returns the underlying V8Object that represents this scope. * * @return The underlying V8Object that represents this scope. */ public ObjectMirror getScopeObject() { V8Object mirror = null; try { mirror = v8Object.executeObjectFunction(SCOPE_OBJECT, null); return (ObjectMirror) createMirror(mirror); } finally { if ( mirror != null ) { mirror.close(); } } }
/** * Returns the scope at a given index. * * @param index The index * @return The scope */ public Scope getScope(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object scope = null; try { scope = v8Object.executeObjectFunction(SCOPE, parameters); return new Scope(scope); } finally { parameters.close(); if (scope != null) { scope.close(); } } }
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); scope.setVariableValue("z", false); scope.close(); frame.close(); } });
/** * Returns the underlying V8Object that represents this scope. * * @return The underlying V8Object that represents this scope. */ public ObjectMirror getScopeObject() { V8Object mirror = null; try { mirror = v8Object.executeObjectFunction(SCOPE_OBJECT, null); return (ObjectMirror) createMirror(mirror); } finally { if ( mirror != null ) { mirror.release(); } } }
/** * Returns the scope at a given index. * * @param index The index * @return The scope */ public Scope getScope(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object scope = null; try { scope = v8Object.executeObjectFunction(SCOPE, parameters); return new Scope(scope); } finally { parameters.release(); if (scope != null) { scope.release(); } } }
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); scope.setVariableValue("z", "someString"); scope.close(); frame.close(); } });
/** * Returns the underlying V8Object that represents this scope. * * @return The underlying V8Object that represents this scope. */ public ObjectMirror getScopeObject() { V8Object mirror = null; try { mirror = v8Object.executeObjectFunction(SCOPE_OBJECT, null); return (ObjectMirror) createMirror(mirror); } finally { if ( mirror != null ) { mirror.release(); } } }
/** * Returns the scope at a given index. * * @param index The index * @return The scope */ public Scope getScope(final int index) { V8Array parameters = new V8Array(v8Object.getRuntime()); parameters.push(index); V8Object scope = null; try { scope = v8Object.executeObjectFunction(SCOPE, parameters); return new Scope(scope); } finally { parameters.release(); if (scope != null) { scope.release(); } } }
@Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); Scope scope = frame.getScope(0); V8Object newValue = new V8Object(v8); newValue.add("foo", "bar"); scope.setVariableValue("z", newValue); newValue.close(); scope.close(); frame.close(); } });