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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame | 1332 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame |
1333 * @param {number} ordinal | 1333 * @param {number} ordinal |
1334 */ | 1334 */ |
1335 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) | 1335 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) |
1336 { | 1336 { |
1337 this._callFrame = callFrame; | 1337 this._callFrame = callFrame; |
1338 this._payload = callFrame._payload.scopeChain[ordinal]; | 1338 this._payload = callFrame._payload.scopeChain[ordinal]; |
1339 this._type = this._payload.type; | 1339 this._type = this._payload.type; |
1340 this._name = this._payload.name; | 1340 this._name = this._payload.name; |
1341 this._ordinal = ordinal; | 1341 this._ordinal = ordinal; |
| 1342 this._startLocation = this._payload.startLocation ? WebInspector.DebuggerMod
el.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) :
null; |
| 1343 this._endLocation = this._payload.endLocation ? WebInspector.DebuggerModel.L
ocation.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : null; |
1342 } | 1344 } |
1343 | 1345 |
1344 WebInspector.DebuggerModel.Scope.prototype = { | 1346 WebInspector.DebuggerModel.Scope.prototype = { |
1345 /** | 1347 /** |
1346 * @return {string} | 1348 * @return {string} |
1347 */ | 1349 */ |
1348 type: function() | 1350 type: function() |
1349 { | 1351 { |
1350 return this._type; | 1352 return this._type; |
1351 }, | 1353 }, |
1352 | 1354 |
1353 /** | 1355 /** |
1354 * @return {string|undefined} | 1356 * @return {string|undefined} |
1355 */ | 1357 */ |
1356 name: function() | 1358 name: function() |
1357 { | 1359 { |
1358 return this._name; | 1360 return this._name; |
1359 }, | 1361 }, |
1360 | 1362 |
1361 /** | 1363 /** |
| 1364 * @return {?WebInspector.DebuggerModel.Location} |
| 1365 */ |
| 1366 startLocation: function() |
| 1367 { |
| 1368 return this._startLocation; |
| 1369 }, |
| 1370 |
| 1371 /** |
| 1372 * @return {?WebInspector.DebuggerModel.Location} |
| 1373 */ |
| 1374 endLocation: function() |
| 1375 { |
| 1376 return this._endLocation; |
| 1377 }, |
| 1378 |
| 1379 /** |
1362 * @return {!WebInspector.RemoteObject} | 1380 * @return {!WebInspector.RemoteObject} |
1363 */ | 1381 */ |
1364 object: function() | 1382 object: function() |
1365 { | 1383 { |
1366 if (this._object) | 1384 if (this._object) |
1367 return this._object; | 1385 return this._object; |
1368 var runtimeModel = this._callFrame.target().runtimeModel; | 1386 var runtimeModel = this._callFrame.target().runtimeModel; |
1369 | 1387 |
1370 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; | 1388 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; |
1371 if (declarativeScope) | 1389 if (declarativeScope) |
1372 this._object = runtimeModel.createScopeRemoteObject(this._payload.ob
ject, new WebInspector.ScopeRef(this._ordinal, this._callFrame.id, undefined)); | 1390 this._object = runtimeModel.createScopeRemoteObject(this._payload.ob
ject, new WebInspector.ScopeRef(this._ordinal, this._callFrame.id, undefined)); |
1373 else | 1391 else |
1374 this._object = runtimeModel.createRemoteObject(this._payload.object)
; | 1392 this._object = runtimeModel.createRemoteObject(this._payload.object)
; |
1375 | 1393 |
1376 return this._callFrame.target().runtimeModel.createRemoteObject(this._pa
yload.object); | 1394 return this._object; |
1377 }, | 1395 }, |
1378 | 1396 |
1379 /** | 1397 /** |
1380 * @return {string} | 1398 * @return {string} |
1381 */ | 1399 */ |
1382 description: function() | 1400 description: function() |
1383 { | 1401 { |
1384 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; | 1402 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; |
1385 return declarativeScope ? "" : (this._payload.object.description || ""); | 1403 return declarativeScope ? "" : (this._payload.object.description || ""); |
1386 } | 1404 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 /** | 1486 /** |
1469 * @param {?WebInspector.Target} target | 1487 * @param {?WebInspector.Target} target |
1470 * @return {?WebInspector.DebuggerModel} | 1488 * @return {?WebInspector.DebuggerModel} |
1471 */ | 1489 */ |
1472 WebInspector.DebuggerModel.fromTarget = function(target) | 1490 WebInspector.DebuggerModel.fromTarget = function(target) |
1473 { | 1491 { |
1474 if (!target || !target.hasJSContext()) | 1492 if (!target || !target.hasJSContext()) |
1475 return null; | 1493 return null; |
1476 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); | 1494 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); |
1477 } | 1495 } |
OLD | NEW |