| 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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 } | 639 } |
| 640 if (ownProperties) { | 640 if (ownProperties) { |
| 641 if (object.__proto__ && !accessorPropertiesOnly) | 641 if (object.__proto__ && !accessorPropertiesOnly) |
| 642 yield { name: "__proto__", value: object.__proto__, writable
: true, configurable: true, enumerable: false, isOwn: true, __proto__: null }; | 642 yield { name: "__proto__", value: object.__proto__, writable
: true, configurable: true, enumerable: false, isOwn: true, __proto__: null }; |
| 643 break; | 643 break; |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 }, | 646 }, |
| 647 | 647 |
| 648 /** | 648 /** |
| 649 * @param {string} expression | |
| 650 * @param {string} objectGroup | |
| 651 * @param {boolean} injectCommandLineAPI | |
| 652 * @param {boolean} returnByValue | |
| 653 * @param {boolean} generatePreview | |
| 654 * @return {*} | |
| 655 */ | |
| 656 evaluate: function(expression, objectGroup, injectCommandLineAPI, returnByVa
lue, generatePreview) | |
| 657 { | |
| 658 var scopeExtensionForEval = injectCommandLineAPI ? new CommandLineAPI(th
is._commandLineAPIImpl) : undefined; | |
| 659 var wrappedResult = InjectedScriptHost.evaluateWithExceptionDetails(expr
ession, scopeExtensionForEval); | |
| 660 if (objectGroup === "console" && !wrappedResult.exceptionDetails) | |
| 661 this._lastResult = wrappedResult.result; | |
| 662 if (!wrappedResult.exceptionDetails) { | |
| 663 return { wasThrown: false, | |
| 664 result: this._wrapObject(wrappedResult.result, objectGroup,
returnByValue, generatePreview), | |
| 665 __proto__: null }; | |
| 666 } | |
| 667 return this._createThrownValue(wrappedResult.result, objectGroup, genera
tePreview, wrappedResult.exceptionDetails); | |
| 668 }, | |
| 669 | |
| 670 /** | |
| 671 * @param {string} objectId | 649 * @param {string} objectId |
| 672 * @param {string} expression | 650 * @param {string} expression |
| 673 * @param {string} args | 651 * @param {string} args |
| 674 * @param {boolean} returnByValue | 652 * @param {boolean} returnByValue |
| 675 * @return {!Object|string} | 653 * @return {!Object|string} |
| 676 */ | 654 */ |
| 677 callFunctionOn: function(objectId, expression, args, returnByValue) | 655 callFunctionOn: function(objectId, expression, args, returnByValue) |
| 678 { | 656 { |
| 679 var parsedObjectId = this._parseObjectId(objectId); | 657 var parsedObjectId = this._parseObjectId(objectId); |
| 680 var object = this._objectForId(parsedObjectId); | 658 var object = this._objectForId(parsedObjectId); |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 */ | 1743 */ |
| 1766 _logEvent: function(event) | 1744 _logEvent: function(event) |
| 1767 { | 1745 { |
| 1768 inspectedGlobalObject.console.log(event.type, event); | 1746 inspectedGlobalObject.console.log(event.type, event); |
| 1769 } | 1747 } |
| 1770 } | 1748 } |
| 1771 | 1749 |
| 1772 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); | 1750 injectedScript._commandLineAPIImpl = new CommandLineAPIImpl(); |
| 1773 return injectedScript; | 1751 return injectedScript; |
| 1774 }) | 1752 }) |
| OLD | NEW |