Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: Source/core/inspector/DebuggerScript.js

Issue 1249013002: DevTools: simplify setScriptSource and restartFrame return values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed dgozman's comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 })();
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698