| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 { | 381 { |
| 382 return nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eva
l("(" + objectId + ")"))); | 382 return nullifyObjectProto(/** @type {!Object} */ (InjectedScriptHost.eva
l("(" + objectId + ")"))); |
| 383 }, | 383 }, |
| 384 | 384 |
| 385 clearLastEvaluationResult: function() | 385 clearLastEvaluationResult: function() |
| 386 { | 386 { |
| 387 delete this._lastResult; | 387 delete this._lastResult; |
| 388 }, | 388 }, |
| 389 | 389 |
| 390 /** | 390 /** |
| 391 * @param {string} objectId | |
| 392 */ | |
| 393 setLastEvaluationResult: function(objectId) | |
| 394 { | |
| 395 var parsedObjectId = this._parseObjectId(objectId); | |
| 396 var object = this._objectForId(parsedObjectId); | |
| 397 this._lastResult = object; | |
| 398 }, | |
| 399 | |
| 400 /** | |
| 401 * @param {string} methodName | 391 * @param {string} methodName |
| 402 * @param {string} args | 392 * @param {string} args |
| 403 * @return {*} | 393 * @return {*} |
| 404 */ | 394 */ |
| 405 dispatch: function(methodName, args) | 395 dispatch: function(methodName, args) |
| 406 { | 396 { |
| 407 var argsArray = /** @type {!Array.<*>} */ (InjectedScriptHost.eval("(" +
args + ")")); | 397 var argsArray = /** @type {!Array.<*>} */ (InjectedScriptHost.eval("(" +
args + ")")); |
| 408 var result = InjectedScriptHost.callFunction(this[methodName], this, arg
sArray); | 398 var result = InjectedScriptHost.callFunction(this[methodName], this, arg
sArray); |
| 409 if (typeof result === "undefined") { | 399 if (typeof result === "undefined") { |
| 410 inspectedWindow.console.error("Web Inspector error: InjectedScript.%
s returns undefined", methodName); | 400 inspectedWindow.console.error("Web Inspector error: InjectedScript.%
s returns undefined", methodName); |
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 */ | 1939 */ |
| 1950 _logEvent: function(event) | 1940 _logEvent: function(event) |
| 1951 { | 1941 { |
| 1952 inspectedWindow.console.log(event.type, event); | 1942 inspectedWindow.console.log(event.type, event); |
| 1953 } | 1943 } |
| 1954 } | 1944 } |
| 1955 | 1945 |
| 1956 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1946 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 1957 return injectedScript; | 1947 return injectedScript; |
| 1958 }) | 1948 }) |
| OLD | NEW |