mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
9c5ed9f5ef
After reviewing how the EnvironmentClient is used, it looks like the use of eventSource might be some cruft from the past. Here is the try run: https://treeherder.mozilla.org/#/jobs?repo=try&selectedJob=242251058&revision=df4bb52f188f79b8006e8c40401e5af2258493ce with the exception of whatever is going on Window 7 (which appeares also on central), it looks like things are working as expected. The environment client will eventually have the event emitter, once it is moved to being a front. adding @nchevobbe as a subscriber, as this touches a dependancy of the scratchpad. Differential Revision: https://phabricator.services.mozilla.com/D28962 --HG-- extra : moz-landing-system : lando
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
const {arg, DebuggerClient} = require("devtools/shared/client/debugger-client");
|
|
|
|
/**
|
|
* Environment clients are used to manipulate the lexical environment actors.
|
|
*
|
|
* @param client DebuggerClient
|
|
* The debugger client parent.
|
|
* @param form Object
|
|
* The form sent across the remote debugging protocol.
|
|
*/
|
|
function EnvironmentClient(client, form) {
|
|
this._client = client;
|
|
this._form = form;
|
|
this.request = this._client.request;
|
|
}
|
|
exports.EnvironmentClient = EnvironmentClient;
|
|
|
|
EnvironmentClient.prototype = {
|
|
|
|
get actor() {
|
|
return this._form.actor;
|
|
},
|
|
get _transport() {
|
|
return this._client._transport;
|
|
},
|
|
|
|
/**
|
|
* Fetches the bindings introduced by this lexical environment.
|
|
*/
|
|
getBindings: DebuggerClient.requester({
|
|
type: "bindings",
|
|
}),
|
|
|
|
/**
|
|
* Changes the value of the identifier whose name is name (a string) to that
|
|
* represented by value (a grip).
|
|
*/
|
|
assign: DebuggerClient.requester({
|
|
type: "assign",
|
|
name: arg(0),
|
|
value: arg(1),
|
|
}),
|
|
};
|
|
|
|
module.exports = EnvironmentClient;
|