OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 scriptToEdit = scripts[i]; | 288 scriptToEdit = scripts[i]; |
289 break; | 289 break; |
290 } | 290 } |
291 } | 291 } |
292 if (!scriptToEdit) | 292 if (!scriptToEdit) |
293 throw("Script not found"); | 293 throw("Script not found"); |
294 | 294 |
295 var changeLog = []; | 295 var changeLog = []; |
296 try { | 296 try { |
297 var result = Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, pre
view, changeLog); | 297 var result = Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, pre
view, changeLog); |
298 return [0, result]; | 298 return [0, result.stack_modified]; |
299 } catch (e) { | 299 } catch (e) { |
300 if (e instanceof Debug.LiveEdit.Failure && "details" in e) { | 300 if (e instanceof Debug.LiveEdit.Failure && "details" in e) { |
301 var details = e.details; | 301 var details = e.details; |
302 if (details.type === "liveedit_compile_error") { | 302 if (details.type === "liveedit_compile_error") { |
303 var startPosition = details.position.start; | 303 var startPosition = details.position.start; |
304 return [1, String(e), String(details.syntaxErrorMessage), Number
(startPosition.line), Number(startPosition.column)]; | 304 return [1, String(e), String(details.syntaxErrorMessage), Number
(startPosition.line), Number(startPosition.column)]; |
305 } | 305 } |
306 } | 306 } |
307 throw e; | 307 throw e; |
308 } | 308 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 return location ? location.column : 0; | 483 return location ? location.column : 0; |
484 } | 484 } |
485 | 485 |
486 function evaluate(expression, scopeExtension) | 486 function evaluate(expression, scopeExtension) |
487 { | 487 { |
488 return frameMirror.evaluate(expression, false, scopeExtension).value(); | 488 return frameMirror.evaluate(expression, false, scopeExtension).value(); |
489 } | 489 } |
490 | 490 |
491 function restart() | 491 function restart() |
492 { | 492 { |
493 return Debug.LiveEdit.RestartFrame(frameMirror); | 493 return frameMirror.restart(); |
494 } | 494 } |
495 | 495 |
496 function setVariableValue(scopeNumber, variableName, newValue) | 496 function setVariableValue(scopeNumber, variableName, newValue) |
497 { | 497 { |
498 return DebuggerScript._setScopeVariableValue(frameMirror, scopeNumber, v
ariableName, newValue); | 498 return DebuggerScript._setScopeVariableValue(frameMirror, scopeNumber, v
ariableName, newValue); |
499 } | 499 } |
500 | 500 |
501 function stepInPositions() | 501 function stepInPositions() |
502 { | 502 { |
503 var stepInPositionsV8 = frameMirror.stepInPositions(); | 503 var stepInPositionsV8 = frameMirror.stepInPositions(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 "parentPromise": eventData.parentPromise().value(), | 582 "parentPromise": eventData.parentPromise().value(), |
583 "status": eventData.status() | 583 "status": eventData.status() |
584 }; | 584 }; |
585 } | 585 } |
586 | 586 |
587 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. | 587 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. |
588 ToggleMirrorCache(false); | 588 ToggleMirrorCache(false); |
589 | 589 |
590 return DebuggerScript; | 590 return DebuggerScript; |
591 })(); | 591 })(); |
OLD | NEW |