Freezing function proxies doesn't work.

RESOLVED FIXED in mozilla13

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

Trunk
mozilla13
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
Created attachment 592911 [details] [diff] [review]
test case: Once a function proxy has been frozen, operating on it should not cause its trap handlers to be called.

Function proxies' trap handlers can get called even after they've been frozen:

    $ cat ~/moz/fproxy.js
    function x() {}
    var handler = {
        getOwnPropertyNames: function () {
            print("Hi!");
            return[];
        },
        fix:function(){ return{} }
    };
    var fp = Proxy.createFunction(handler,x,x);
    Object.freeze(fp);
    print("Frozen.");
    Object.getOwnPropertyNames(fp);
    $ obj~/js -f ~/moz/fproxy.js
    Hi!
    Frozen.
    Hi!
    $
(Assignee)

Comment 1

6 years ago
Try: https://tbpl.mozilla.org/?tree=Try&rev=2ba50d492112
(Assignee)

Comment 2

6 years ago
Created attachment 592986 [details] [diff] [review]
Once a function proxy has been frozen, operating on it should not cause its trap handlers to be called.
(Assignee)

Updated

6 years ago
Attachment #592911 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Status: NEW → ASSIGNED
Flags: in-testsuite+
(Assignee)

Updated

6 years ago
Assignee: general → jimb
(Assignee)

Updated

6 years ago
Attachment #592986 - Flags: review?(gal)

Comment 3

6 years ago
Comment on attachment 592986 [details] [diff] [review]
Once a function proxy has been frozen, operating on it should not cause its trap handlers to be called.

Those are some pretty tests. Made my day to read them.
Attachment #592986 - Flags: review?(gal) → review+
(Assignee)

Comment 4

6 years ago
(In reply to Andreas Gal :gal from comment #3)
> Comment on attachment 592986 [details] [diff] [review]
> Once a function proxy has been frozen, operating on it should not cause its
> trap handlers to be called.
> 
> Those are some pretty tests. Made my day to read them.

For a one-line change, too. :) Thanks for the review!

https://hg.mozilla.org/integration/mozilla-inbound/rev/cface840992d
That changeset log message omits the r=gal; apologies, folks.
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/cface840992d
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.