Closed Bug 607284 Opened 9 years ago Closed 9 years ago

getOwnPropertyDescriptor across different js sandboxes misbehaves

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- beta7+

People

(Reporter: irakli, Assigned: peterv)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Hi,

After recent changes in nightlies jetpack got pretty much broken. After some investigation I have discovered that's due to changes introduced by compartments (under impression that Proxy accesses wrapped object's property accessors, when `getOwnPropertyDescriptor` is used).

Here is a snippet to reproduce an error:  

js> Components.utils.Sandbox('http://whatever.com').Object.getOwnPropertyDescriptor({ get test() { throw new Error('boom!') } }, 'test')
Details:
  message: boom!  fileName: resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> <string>  lineNumber: 1  stack:
    ()@resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> <string>:1
    @:0
    @:0
    @resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> resource://jid0-mmwjgriwzxjcg1sggnfxqfhdxba-jetpack-core-lib/securable-module.js -> <string>:1  name: Error

More details on this issue can be found here:
https://bugzilla.mozilla.org/show_bug.cgi?id=607278
Assignee: general → peterv
blocking2.0: --- → ?
On current trunk I see:

js> Components.utils.Sandbox('http://whatever.com').Object.getOwnPropertyDescriptor({ get test() { throw new Error('boom!') } }, 'test')
typein:1: boom!
Attached patch v1Splinter Review
Attachment #486194 - Flags: review?(mrbkap)
Attachment #486194 - Flags: review?(mrbkap) → review+
Peter says we need this to fix some of the Jetpack issues that block beta7.
blocking2.0: ? → beta7+
http://hg.mozilla.org/mozilla-central/rev/37f12060ec3c
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.