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

Side by Side Diff: test/debugger/test-api.js

Issue 2687013003: Revert of [debugger] expose side-effect free evaluate to inspector. (Closed)
Patch Set: Created 3 years, 10 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 | « test/debugger/debug/debug-evaluate-no-side-effect-builtins.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 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // If true, prints all messages sent and received by inspector. 7 // If true, prints all messages sent and received by inspector.
8 const printProtocolMessages = false; 8 const printProtocolMessages = false;
9 9
10 // The active wrapper instance. 10 // The active wrapper instance.
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 670 }
671 } 671 }
672 672
673 return { value : () => value, 673 return { value : () => value,
674 isUndefined : () => isUndefined, 674 isUndefined : () => isUndefined,
675 type : () => obj.type, 675 type : () => obj.type,
676 className : () => obj.className 676 className : () => obj.className
677 }; 677 };
678 } 678 }
679 679
680 evaluateOnCallFrame(frame, expr, throw_on_side_effect = false) { 680 evaluateOnCallFrame(frame, expr) {
681 const frameid = frame.callFrameId; 681 const frameid = frame.callFrameId;
682 const {msgid, msg} = this.createMessage( 682 const {msgid, msg} = this.createMessage(
683 "Debugger.evaluateOnCallFrame", 683 "Debugger.evaluateOnCallFrame",
684 { callFrameId : frameid, 684 { callFrameId : frameid,
685 expression : expr, 685 expression : expr
686 throwOnSideEffect : throw_on_side_effect,
687 }); 686 });
688 this.sendMessage(msg); 687 this.sendMessage(msg);
689 const reply = this.takeReplyChecked(msgid); 688 const reply = this.takeReplyChecked(msgid);
690 689
691 const result = reply.result.result; 690 const result = reply.result.result;
692 return this.reconstructRemoteObject(result); 691 return this.reconstructRemoteObject(result);
693 } 692 }
694 693
695 frameReceiver(frame) { 694 frameReceiver(frame) {
696 return this.reconstructRemoteObject(frame.this); 695 return this.reconstructRemoteObject(frame.this);
(...skipping 24 matching lines...) Expand all
721 for (let i = 0; i < frame.scopeChain.length; i++) { 720 for (let i = 0; i < frame.scopeChain.length; i++) {
722 scopes.push(this.execStateScope(frame, i)); 721 scopes.push(this.execStateScope(frame, i));
723 } 722 }
724 return scopes; 723 return scopes;
725 } 724 }
726 725
727 return { sourceColumn : () => column, 726 return { sourceColumn : () => column,
728 sourceLine : () => line + 1, 727 sourceLine : () => line + 1,
729 sourceLineText : () => loc.sourceText, 728 sourceLineText : () => loc.sourceText,
730 sourcePosition : () => loc.position, 729 sourcePosition : () => loc.position,
731 evaluate : (expr, throw_on_side_effect) => 730 evaluate : (expr) => this.evaluateOnCallFrame(frame, expr),
732 this.evaluateOnCallFrame(frame, expr, throw_on_side_effect),
733 functionName : () => frame.functionName, 731 functionName : () => frame.functionName,
734 func : () => func, 732 func : () => func,
735 index : () => index, 733 index : () => index,
736 localCount : () => this.execStateFrameLocalCount(frame), 734 localCount : () => this.execStateFrameLocalCount(frame),
737 localName : (ix) => this.execStateFrameLocalName(frame, ix), 735 localName : (ix) => this.execStateFrameLocalName(frame, ix),
738 localValue: (ix) => this.execStateFrameLocalValue(frame, ix), 736 localValue: (ix) => this.execStateFrameLocalValue(frame, ix),
739 receiver : () => this.frameReceiver(frame), 737 receiver : () => this.frameReceiver(frame),
740 restart : () => this.execStateFrameRestart(frame), 738 restart : () => this.execStateFrameRestart(frame),
741 returnValue : () => this.frameReturnValue(frame), 739 returnValue : () => this.frameReturnValue(frame),
742 scopeCount : () => frame.scopeChain.length, 740 scopeCount : () => frame.scopeChain.length,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 debug.instance = new DebugWrapper(); 888 debug.instance = new DebugWrapper();
891 debug.instance.enable(); 889 debug.instance.enable();
892 } 890 }
893 return debug.instance; 891 return debug.instance;
894 }}); 892 }});
895 893
896 Object.defineProperty(debug, 'ScopeType', { get: function() { 894 Object.defineProperty(debug, 'ScopeType', { get: function() {
897 const instance = debug.Debug; 895 const instance = debug.Debug;
898 return instance.ScopeType; 896 return instance.ScopeType;
899 }}); 897 }});
OLDNEW
« no previous file with comments | « test/debugger/debug/debug-evaluate-no-side-effect-builtins.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698