| 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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame | 1286 * @param {!WebInspector.DebuggerModel.CallFrame} callFrame |
| 1287 * @param {number} ordinal | 1287 * @param {number} ordinal |
| 1288 */ | 1288 */ |
| 1289 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) | 1289 WebInspector.DebuggerModel.Scope = function(callFrame, ordinal) |
| 1290 { | 1290 { |
| 1291 this._callFrame = callFrame; | 1291 this._callFrame = callFrame; |
| 1292 this._payload = callFrame._payload.scopeChain[ordinal]; | 1292 this._payload = callFrame._payload.scopeChain[ordinal]; |
| 1293 this._type = this._payload.type; | 1293 this._type = this._payload.type; |
| 1294 this._name = this._payload.name; | 1294 this._name = this._payload.name; |
| 1295 this._ordinal = ordinal; | 1295 this._ordinal = ordinal; |
| 1296 this._startLocation = this._payload.startLocation ? WebInspector.DebuggerMod
el.Location.fromPayload(callFrame.debuggerModel, this._payload.startLocation) :
null; |
| 1297 this._endLocation = this._payload.endLocation ? WebInspector.DebuggerModel.L
ocation.fromPayload(callFrame.debuggerModel, this._payload.endLocation) : null; |
| 1296 } | 1298 } |
| 1297 | 1299 |
| 1298 WebInspector.DebuggerModel.Scope.prototype = { | 1300 WebInspector.DebuggerModel.Scope.prototype = { |
| 1299 /** | 1301 /** |
| 1300 * @return {string} | 1302 * @return {string} |
| 1301 */ | 1303 */ |
| 1302 type: function() | 1304 type: function() |
| 1303 { | 1305 { |
| 1304 return this._type; | 1306 return this._type; |
| 1305 }, | 1307 }, |
| 1306 | 1308 |
| 1307 /** | 1309 /** |
| 1308 * @return {string|undefined} | 1310 * @return {string|undefined} |
| 1309 */ | 1311 */ |
| 1310 name: function() | 1312 name: function() |
| 1311 { | 1313 { |
| 1312 return this._name; | 1314 return this._name; |
| 1313 }, | 1315 }, |
| 1314 | 1316 |
| 1315 /** | 1317 /** |
| 1318 * @return {?WebInspector.DebuggerModel.Location} |
| 1319 */ |
| 1320 startLocation: function() |
| 1321 { |
| 1322 return this._startLocation; |
| 1323 }, |
| 1324 |
| 1325 /** |
| 1326 * @return {?WebInspector.DebuggerModel.Location} |
| 1327 */ |
| 1328 endLocation: function() |
| 1329 { |
| 1330 return this._endLocation; |
| 1331 }, |
| 1332 |
| 1333 /** |
| 1316 * @return {!WebInspector.RemoteObject} | 1334 * @return {!WebInspector.RemoteObject} |
| 1317 */ | 1335 */ |
| 1318 object: function() | 1336 object: function() |
| 1319 { | 1337 { |
| 1320 if (this._object) | 1338 if (this._object) |
| 1321 return this._object; | 1339 return this._object; |
| 1322 var runtimeModel = this._callFrame.target().runtimeModel; | 1340 var runtimeModel = this._callFrame.target().runtimeModel; |
| 1323 | 1341 |
| 1324 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; | 1342 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; |
| 1325 if (declarativeScope) | 1343 if (declarativeScope) |
| 1326 this._object = runtimeModel.createScopeRemoteObject(this._payload.ob
ject, new WebInspector.ScopeRef(this._ordinal, this._callFrame.id, undefined)); | 1344 this._object = runtimeModel.createScopeRemoteObject(this._payload.ob
ject, new WebInspector.ScopeRef(this._ordinal, this._callFrame.id, undefined)); |
| 1327 else | 1345 else |
| 1328 this._object = runtimeModel.createRemoteObject(this._payload.object)
; | 1346 this._object = runtimeModel.createRemoteObject(this._payload.object)
; |
| 1329 | 1347 |
| 1330 return this._callFrame.target().runtimeModel.createRemoteObject(this._pa
yload.object); | 1348 return this._object; |
| 1331 }, | 1349 }, |
| 1332 | 1350 |
| 1333 /** | 1351 /** |
| 1334 * @return {string} | 1352 * @return {string} |
| 1335 */ | 1353 */ |
| 1336 description: function() | 1354 description: function() |
| 1337 { | 1355 { |
| 1338 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; | 1356 var declarativeScope = this._type !== DebuggerAgent.ScopeType.With && th
is._type !== DebuggerAgent.ScopeType.Global; |
| 1339 return declarativeScope ? "" : (this._payload.object.description || ""); | 1357 return declarativeScope ? "" : (this._payload.object.description || ""); |
| 1340 } | 1358 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 /** | 1440 /** |
| 1423 * @param {?WebInspector.Target} target | 1441 * @param {?WebInspector.Target} target |
| 1424 * @return {?WebInspector.DebuggerModel} | 1442 * @return {?WebInspector.DebuggerModel} |
| 1425 */ | 1443 */ |
| 1426 WebInspector.DebuggerModel.fromTarget = function(target) | 1444 WebInspector.DebuggerModel.fromTarget = function(target) |
| 1427 { | 1445 { |
| 1428 if (!target || !target.hasJSContext()) | 1446 if (!target || !target.hasJSContext()) |
| 1429 return null; | 1447 return null; |
| 1430 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); | 1448 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector
.DebuggerModel)); |
| 1431 } | 1449 } |
| OLD | NEW |