Skip to content

Commit 20a50e2

Browse files
committed
#19 TypeError: form.setFormProperty is not a function
1 parent 598f2dc commit 20a50e2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/firequery-actor.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const OBJECT_PREVIEW_MAX_ITEMS = 10;
3131
// on the backend (in case of remote device debugging).
3232
const baseUrl = "resource://firequery-at-binaryage-dot-com/";
3333
const { getTrace } = Cu.import(baseUrl + "node_modules/firebug.sdk/lib/core/actor.js");
34-
const Trace = getTrace();
34+
const Trace = getTrace(DebuggerServer.parentMessageManager);
3535
//const Trace = {sysout: () => {}};
3636

3737
/**
@@ -316,7 +316,7 @@ var FireQueryActor = ActorClass(
316316
// Pass only a flag that says whether there are any jQuery
317317
// data associated or not. The data itself will be fetched
318318
// on demand (when displayed e.g. in a tooltip)
319-
form.setFormProperty("hasJQueryData", !!data)
319+
form.setFormProperty("hasJQueryData", !!data);
320320

321321
let json = data ? JSON.stringify(data) : "";
322322
Trace.sysout("FireQueryActor.onNodeActorForm; " + json, arguments);
@@ -370,9 +370,14 @@ function hasJQueryData(object) {
370370
// xxxHonza: Can be removed as soon as Firefox 41 is the
371371
// minimum required version.
372372
let originalForm = NodeActor.prototype.form;
373-
NodeActor.prototype.form = function() {
373+
NodeActor.prototype.form = function(detail) {
374374
let form = originalForm.apply(this, arguments);
375375

376+
// The return value doesn't always have to be a form object.
377+
if (detail === "actorid") {
378+
return form;
379+
}
380+
376381
// form.setFormProperty has been introduced in Bug 1036949
377382
// (released in Firefox 41)
378383
// The content of the following if block is taken from the

0 commit comments

Comments
 (0)