Bug 1570744 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Minimal STR:

1. Run the following code in the Browser Console:

```
{
  class MyActor extends JSWindowActorChild {};
  MyActor.prototype.QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);

  let instance = new MyActor();
  Services.prefs.addObserver("foo.bar", instance);
}
```

ER:

`instance` is added as an observer for a preference.

AR:

The following exception is thrown:

```
[Exception... "Could not convert JavaScript argument arg 1 [nsIPrefBranch.addObserver]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1"  data: no]
```
Minimal STR:

1. Run the following code in the Browser Console:

```javascript
{
  class MyActor extends JSWindowActorChild {};
  MyActor.prototype.QueryInterface = ChromeUtils.generateQI(["nsIObserver"]);

  let instance = new MyActor();
  Services.prefs.addObserver("foo.bar", instance);
}
```

ER:

`instance` is added as an observer for a preference.

AR:

The following exception is thrown:

```
[Exception... "Could not convert JavaScript argument arg 1 [nsIPrefBranch.addObserver]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: debugger eval code :: <TOP_LEVEL> :: line 1"  data: no]
```

Back to Bug 1570744 Comment 0