scriptName = "undefined"; return new SourceLocation(scriptName, sourceLocation.getInteger(POSITION), sourceLocation.getInteger(LINE),
@Test public void testGetSourceLocation() { handleBreak(new BreakHandler() { @Override public void onBreak(final DebugEvent event, final ExecutionState state, final EventData eventData, final V8Object data) { Frame frame = state.getFrame(0); result = frame.getSourceLocation(); frame.close(); } }); v8.executeScript(script, "script", 0); assertEquals(5, ((SourceLocation) result).getLine()); assertEquals("script", ((SourceLocation) result).getScriptName()); assertEquals(0, ((SourceLocation) result).getColumn()); }
scriptName = "undefined"; return new SourceLocation(scriptName, sourceLocation.getInteger(POSITION), sourceLocation.getInteger(LINE),
/** * Returns the SourceLocation of this Frame. * * @return The SourceLocation of this Frame. */ public SourceLocation getSourceLocation() { V8Object sourceLocation = v8Object.executeObjectFunction(SOURCE_LOCATION, null); try { V8Object scriptObject = (V8Object) sourceLocation.get(SCRIPT); String scriptName = scriptObject.getString(NAME); scriptObject.release(); return new SourceLocation(scriptName, sourceLocation.getInteger(POSITION), sourceLocation.getInteger(LINE), sourceLocation.getInteger(COLUMN), sourceLocation.getInteger(START), sourceLocation.getInteger(END)); } finally { sourceLocation.release(); } }
/** * Returns the SourceLocation of this Frame. * * @return The SourceLocation of this Frame. */ public SourceLocation getSourceLocation() { V8Object sourceLocation = v8Object.executeObjectFunction(SOURCE_LOCATION, null); try { V8Object scriptObject = (V8Object) sourceLocation.get(SCRIPT); String scriptName = scriptObject.getString(NAME); scriptObject.release(); return new SourceLocation(scriptName, sourceLocation.getInteger(POSITION), sourceLocation.getInteger(LINE), sourceLocation.getInteger(COLUMN), sourceLocation.getInteger(START), sourceLocation.getInteger(END)); } finally { sourceLocation.release(); } }