Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/devtools/client/webconsole/utils/context-menu.js b/devtools/client/webconsole/utils/context-menu.js
- index 29f0d485e57f..37115d70c9e5 100644
- --- a/devtools/client/webconsole/utils/context-menu.js
- +++ b/devtools/client/webconsole/utils/context-menu.js
- @@ -4,6 +4,8 @@
- "use strict";
- +// useful
- +
- const Menu = require("devtools/client/framework/menu");
- const MenuItem = require("devtools/client/framework/menu-item");
- diff --git a/devtools/client/webconsole/webconsole-wrapper.js b/devtools/client/webconsole/webconsole-wrapper.js
- index 15d651279771..10bc443d40f2 100644
- --- a/devtools/client/webconsole/webconsole-wrapper.js
- +++ b/devtools/client/webconsole/webconsole-wrapper.js
- @@ -15,9 +15,13 @@ const actions = require("devtools/client/webconsole/actions/index");
- const {
- createEditContextMenu,
- } = require("devtools/client/framework/toolbox-context-menu");
- +
- +// context menu
- const {
- createContextMenu,
- } = require("devtools/client/webconsole/utils/context-menu");
- +
- +
- const { configureStore } = require("devtools/client/webconsole/store");
- const { PREFS } = require("devtools/client/webconsole/constants");
- diff --git a/devtools/server/actors/object.js b/devtools/server/actors/object.js
- index 3acfc936b29b..b9185c0a3eb8 100644
- --- a/devtools/server/actors/object.js
- +++ b/devtools/server/actors/object.js
- @@ -108,17 +108,20 @@ const proto = {
- },
- addWatchpoint(property, label, watchpointType) {
- + // We promote the object actor to the thread pool
- + // so that it lives for the lifetime of the watchpoint.
- + this.thread.threadObjectGrip(this);
- +
- if (this._originalDescriptors.has(property)) {
- return;
- }
- const desc = this.obj.getOwnPropertyDescriptor(property);
- - //If there is already a setter or getter, don't add watchpoint.
- if (desc.set || desc.get) {
- return;
- }
- - this._originalDescriptors.set(property, desc);
- + this._originalDescriptors.set(property, { desc, watchpointType });
- const pauseAndRespond = () => {
- const frame = this.thread.dbg.getNewestFrame();
- @@ -137,6 +140,7 @@ const proto = {
- }),
- get: this.obj.makeDebuggeeValue(() => {
- pauseAndRespond();
- + return desc.value;
- }),
- });
- }
- @@ -146,8 +150,11 @@ const proto = {
- configurable: desc.configurable,
- enumerable: desc.enumerable,
- set: this.obj.makeDebuggeeValue(v => {
- - desc.value = v;
- pauseAndRespond();
- + desc.value = v;
- + }),
- + get: this.obj.makeDebuggeeValue(() => {
- + return desc.value;
- }),
- });
- }
- @@ -158,11 +165,17 @@ const proto = {
- return;
- }
- - const desc = this._originalDescriptors.get(property);
- + const desc = this._originalDescriptors.get(property).desc;
- this._originalDescriptors.delete(property);
- this.obj.defineProperty(property, desc);
- },
- + removeWatchpoints() {
- + this._originalDescriptors.forEach(
- + property => this.removeWatchpoint(property)
- + );
- + },
- +
- /**
- * Returns a grip for this actor for returning in a protocol message.
- */
- @@ -430,6 +443,13 @@ const proto = {
- return safeGetterValues;
- }
- + // Do not search for safe getters while replaying. While this would be nice
- + // to support, it involves a lot of back-and-forth between processes and
- + // would be better to do entirely in the replaying process.
- + if (isReplaying) {
- + return safeGetterValues;
- + }
- +
- // Most objects don't have any safe getters but inherit some from their
- // prototype. Avoid calling getOwnPropertyNames on objects that may have
- // many properties like Array, strings or js objects. That to avoid
- @@ -781,8 +801,9 @@ const proto = {
- retval.writable = desc.writable;
- retval.value = this.hooks.createValueGrip(desc.value);
- } else if (this._originalDescriptors.has(name)) {
- - const value = this._originalDescriptors.get(name).value;
- - retval.value = this.hooks.createValueGrip(value);
- + const { desc, watchpointType } = this._originalDescriptors.get(name);
- + retval.value = this.hooks.createValueGrip(desc.value);
- + retval.watchpoint = watchpointType;
- } else {
- if ("get" in desc) {
- retval.get = this.hooks.createValueGrip(desc.get);
- @@ -1016,7 +1037,9 @@ const proto = {
- * Release the actor, when it isn't needed anymore.
- * Protocol.js uses this release method to call the destroy method.
- */
- - release: function() {},
- + release: function() {
- + this.removeWatchpoints()
- + },
- };
- exports.ObjectActor = protocol.ActorClassWithSpec(objectSpec, proto);
- diff --git a/devtools/server/actors/root.js b/devtools/server/actors/root.js
- index c67ea1c8850c..6c0ba8a37dd3 100644
- --- a/devtools/server/actors/root.js
- +++ b/devtools/server/actors/root.js
- @@ -180,6 +180,9 @@ RootActor.prototype = {
- // Supports native log points and modifying the condition/log of an existing
- // breakpoints. Fx66+
- nativeLogpoints: true,
- +
- + // Supports watchpoints in the server. Fx71+
- + watchpoints: true,
- // support older browsers for Fx69+
- hasThreadFront: true,
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement