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

Side by Side Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 1815753002: [DevTools] Move getFunctionDetails to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-get-internal-properties
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_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 30 matching lines...) Expand all
41 41
42 DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.D ontPauseOnExceptions; 42 DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.D ontPauseOnExceptions;
43 Debug.clearBreakOnException(); 43 Debug.clearBreakOnException();
44 Debug.clearBreakOnUncaughtException(); 44 Debug.clearBreakOnUncaughtException();
45 45
46 DebuggerScript.getAfterCompileScript = function(eventData) 46 DebuggerScript.getAfterCompileScript = function(eventData)
47 { 47 {
48 return DebuggerScript._formatScript(eventData.script_.script_); 48 return DebuggerScript._formatScript(eventData.script_.script_);
49 } 49 }
50 50
51 DebuggerScript._scopeTypeNames = { __proto__: null };
52 DebuggerScript._scopeTypeNames[ScopeType.Global] = "global";
53 DebuggerScript._scopeTypeNames[ScopeType.Local] = "local";
54 DebuggerScript._scopeTypeNames[ScopeType.With] = "with";
55 DebuggerScript._scopeTypeNames[ScopeType.Closure] = "closure";
56 DebuggerScript._scopeTypeNames[ScopeType.Catch] = "catch";
57 DebuggerScript._scopeTypeNames[ScopeType.Block] = "block";
58 DebuggerScript._scopeTypeNames[ScopeType.Script] = "script";
59
51 DebuggerScript.getFunctionScopes = function(fun) 60 DebuggerScript.getFunctionScopes = function(fun)
52 { 61 {
53 var mirror = MakeMirror(fun); 62 var mirror = MakeMirror(fun);
54 if (!mirror.isFunction()) 63 if (!mirror.isFunction())
55 return null; 64 return null;
56 var count = mirror.scopeCount(); 65 var count = mirror.scopeCount();
57 if (count == 0) 66 if (count == 0)
58 return null; 67 return null;
59 var result = []; 68 var result = [];
60 for (var i = 0; i < count; i++) { 69 for (var i = 0; i < count; i++) {
61 var scopeDetails = mirror.scope(i).details(); 70 var scopeDetails = mirror.scope(i).details();
62 var scopeObject = DebuggerScript._buildScopeObject(scopeDetails.type(), scopeDetails.object()); 71 var scopeObject = DebuggerScript._buildScopeObject(scopeDetails.type(), scopeDetails.object());
63 if (!scopeObject) 72 if (!scopeObject)
64 continue; 73 continue;
65 result.push({ 74 result.push({
66 type: scopeDetails.type(), 75 type: DebuggerScript._scopeTypeNames[scopeDetails.type()],
67 object: scopeObject, 76 object: scopeObject,
68 name: scopeDetails.name() 77 name: scopeDetails.name() || ""
69 }); 78 });
70 } 79 }
71 return result; 80 return result;
72 } 81 }
73 82
74 DebuggerScript.getGeneratorObjectDetails = function(object) 83 DebuggerScript.getGeneratorObjectDetails = function(object)
75 { 84 {
76 var mirror = MakeMirror(object, true /* transient */); 85 var mirror = MakeMirror(object, true /* transient */);
77 if (!mirror.isGenerator()) 86 if (!mirror.isGenerator())
78 return null; 87 return null;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 434
426 function lazyScopeChain() 435 function lazyScopeChain()
427 { 436 {
428 if (!scopeChain) { 437 if (!scopeChain) {
429 scopeChain = []; 438 scopeChain = [];
430 scopeStartLocations = []; 439 scopeStartLocations = [];
431 scopeEndLocations = []; 440 scopeEndLocations = [];
432 for (var i = 0, j = 0; i < scopeObjects.length; ++i) { 441 for (var i = 0, j = 0; i < scopeObjects.length; ++i) {
433 var scopeObject = DebuggerScript._buildScopeObject(scopeTypes[i] , scopeObjects[i]); 442 var scopeObject = DebuggerScript._buildScopeObject(scopeTypes[i] , scopeObjects[i]);
434 if (scopeObject) { 443 if (scopeObject) {
435 scopeTypes[j] = scopeTypes[i]; 444 scopeTypes[j] = DebuggerScript._scopeTypeNames[scopeTypes[i] ];
436 scopeNames[j] = scopeNames[i]; 445 scopeNames[j] = scopeNames[i];
437 scopeChain[j] = scopeObject; 446 scopeChain[j] = scopeObject;
438 447
439 var funcMirror = scopeFunctions ? MakeMirror(scopeFunctions[ i]) : null; 448 var funcMirror = scopeFunctions ? MakeMirror(scopeFunctions[ i]) : null;
440 if (!funcMirror || !funcMirror.isFunction()) 449 if (!funcMirror || !funcMirror.isFunction())
441 funcMirror = new UnresolvedFunctionMirror(funcObject); 450 funcMirror = new UnresolvedFunctionMirror(funcObject);
442 451
443 var script = funcMirror.script(); 452 var script = funcMirror.script();
444 scopeStartLocations[j] = createLocation(script, scopeStartPo sitions[i]); 453 scopeStartLocations[j] = createLocation(script, scopeStartPo sitions[i]);
445 scopeEndLocations[j] = createLocation(script, scopeEndPositi ons[i]); 454 scopeEndLocations[j] = createLocation(script, scopeEndPositi ons[i]);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 "parentPromise": eventData.parentPromise().value(), 658 "parentPromise": eventData.parentPromise().value(),
650 "status": eventData.status() 659 "status": eventData.status()
651 }; 660 };
652 } 661 }
653 662
654 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it. 663 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr ors in the cache we disable it.
655 ToggleMirrorCache(false); 664 ToggleMirrorCache(false);
656 665
657 return DebuggerScript; 666 return DebuggerScript;
658 })(); 667 })();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/v8_inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698