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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Issue 2729743002: [DevTools] Move 'this' evaluation from ExecutionContext to autocomplete. (Closed)
Patch Set: Created 3 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 | « third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js ('k') | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 expression, 502 expression,
503 objectGroup, 503 objectGroup,
504 includeCommandLineAPI, 504 includeCommandLineAPI,
505 silent, 505 silent,
506 returnByValue, 506 returnByValue,
507 generatePreview, 507 generatePreview,
508 userGesture, 508 userGesture,
509 callback) { 509 callback) {
510 // FIXME: It will be moved to separate ExecutionContext. 510 // FIXME: It will be moved to separate ExecutionContext.
511 if (this.debuggerModel.selectedCallFrame()) { 511 if (this.debuggerModel.selectedCallFrame()) {
512 this.debuggerModel.evaluateOnSelectedCallFrame( 512 this.debuggerModel.evaluateOnSelectedCallFrame(
einbinder 2017/03/02 01:48:56 Did you test this behavior? Expression will be 'th
dgozman 2017/03/03 23:27:14 Works nicely.
513 expression, objectGroup, includeCommandLineAPI, silent, returnByValue, generatePreview, callback); 513 expression, objectGroup, includeCommandLineAPI, silent, returnByValue, generatePreview, callback);
514 return; 514 return;
515 } 515 }
516 this._evaluateGlobal.apply(this, arguments); 516 this._evaluateGlobal.apply(this, arguments);
517 } 517 }
518 518
519 /** 519 /**
520 * @param {string} objectGroup 520 * @param {string} objectGroup
521 * @param {boolean} generatePreview 521 * @param {boolean} generatePreview
522 * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} c allback 522 * @param {function(?SDK.RemoteObject, !Protocol.Runtime.ExceptionDetails=)} c allback
(...skipping 14 matching lines...) Expand all
537 */ 537 */
538 _evaluateGlobal( 538 _evaluateGlobal(
539 expression, 539 expression,
540 objectGroup, 540 objectGroup,
541 includeCommandLineAPI, 541 includeCommandLineAPI,
542 silent, 542 silent,
543 returnByValue, 543 returnByValue,
544 generatePreview, 544 generatePreview,
545 userGesture, 545 userGesture,
546 callback) { 546 callback) {
547 if (!expression) {
548 // There is no expression, so the completion should happen against global properties.
549 expression = 'this';
550 }
551
552 /** 547 /**
553 * @this {SDK.ExecutionContext} 548 * @this {SDK.ExecutionContext}
554 * @param {?Protocol.Error} error 549 * @param {?Protocol.Error} error
555 * @param {!Protocol.Runtime.RemoteObject} result 550 * @param {!Protocol.Runtime.RemoteObject} result
556 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails 551 * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails
557 */ 552 */
558 function evalCallback(error, result, exceptionDetails) { 553 function evalCallback(error, result, exceptionDetails) {
559 if (error) { 554 if (error) {
560 console.error(error); 555 console.error(error);
561 callback(null); 556 callback(null);
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 this._type === 'wheel'; 805 this._type === 'wheel';
811 } 806 }
812 }; 807 };
813 808
814 /** @enum {string} */ 809 /** @enum {string} */
815 SDK.EventListener.Origin = { 810 SDK.EventListener.Origin = {
816 Raw: 'Raw', 811 Raw: 'Raw',
817 Framework: 'Framework', 812 Framework: 'Framework',
818 FrameworkUser: 'FrameworkUser' 813 FrameworkUser: 'FrameworkUser'
819 }; 814 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698