Closed
Bug 1097987
Opened 10 years ago
Closed 10 years ago
Make all JS::Evaluate and JS_Execute*Script entrypoints take scope chains explicitly
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(7 files, 4 obsolete files)
(deleted),
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bholley
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
The idea is to not have anything except With and globals on the toplevel scope chain. This is bug 679939 comment 29 item 1.
Assignee | ||
Comment 1•10 years ago
|
||
Attachment #8576925 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8576927 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8576928 -
Flags: review?(bobbyholley)
Assignee | ||
Comment 4•10 years ago
|
||
Assignee | ||
Updated•10 years ago
|
Attachment #8576931 -
Flags: review?(bobbyholley)
Assignee | ||
Comment 5•10 years ago
|
||
Attachment #8576932 -
Flags: review?(bobbyholley)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8576935 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 7•10 years ago
|
||
Attachment #8576937 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 8•10 years ago
|
||
Attachment #8576938 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 9•10 years ago
|
||
Attachment #8576975 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8576983 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•10 years ago
|
Attachment #8576937 -
Attachment is obsolete: true
Attachment #8576937 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•10 years ago
|
Attachment #8576975 -
Attachment is obsolete: true
Attachment #8576975 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 11•10 years ago
|
||
Attachment #8576984 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•10 years ago
|
Attachment #8576938 -
Attachment is obsolete: true
Attachment #8576938 -
Flags: review?(jwalden+bmo)
Updated•10 years ago
|
Attachment #8576925 -
Flags: review?(jwalden+bmo) → review+
Updated•10 years ago
|
Attachment #8576927 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8576984 [details] [diff] [review]
part 8. Change ExecuteInGlobalAndReturnScope to not use a random object on the scopechain
Part 8 here is going to need more work. I've spun it off into bug 1142832.
Attachment #8576984 -
Attachment is obsolete: true
Attachment #8576984 -
Flags: review?(jwalden+bmo)
Comment 13•10 years ago
|
||
Comment on attachment 8576928 [details] [diff] [review]
part 3. Change XPCShellEnvironment to use the scopechain version of JS_ExecuteScript as needed
Review of attachment 8576928 [details] [diff] [review]:
-----------------------------------------------------------------
::: ipc/testshell/XPCShellEnvironment.cpp
@@ +171,5 @@
> fclose(file);
> if (!ok)
> return false;
>
> + // XXXbz are we intentionally allowing load.call(someNonGlobalObject)?
No idea. I'd be happy to try throwing for a non-global |obj| and see if it breaks anything.
@@ +340,5 @@
> }
> }
> ungetc(ch, file);
>
> JSAutoRequest ar(cx);
There should be an AutoJSAPI or AutoEntryScript somewhere up the stack, right? If so, I think this JSAutoRequest can go away.
@@ +359,5 @@
> do {
> bufp = buffer;
> *bufp = '\0';
>
> JSAutoRequest ar(cx);
same.
Attachment #8576928 -
Flags: review?(bobbyholley) → review+
Updated•10 years ago
|
Attachment #8576931 -
Flags: review?(bobbyholley) → review+
Updated•10 years ago
|
Attachment #8576932 -
Flags: review?(bobbyholley) → review+
Updated•10 years ago
|
Attachment #8576935 -
Flags: review?(jwalden+bmo) → review+
Comment 14•10 years ago
|
||
Comment on attachment 8576983 [details] [diff] [review]
part 7. Require callers of JS::Evaluate to either use the global as the scope or pass in an explicit scopechain
Review of attachment 8576983 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/xpconnect/src/Sandbox.cpp
@@ +1533,5 @@
> options.setFileAndLine(filenameBuf.get(), lineNo)
> .setVersion(jsVersion);
> JS::RootedObject rootedSandbox(sandcx, sandbox);
> + MOZ_ASSERT(JS_IsGlobalObject(sandbox));
> + ok = JS::Evaluate(sandcx, options,
|rootedSandbox| is an unused variable now -- remove it.
Attachment #8576983 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 15•10 years ago
|
||
> No idea. I'd be happy to try throwing for a non-global |obj| and see if it breaks
> anything.
Alright, let's give it a shot.
> There should be an AutoJSAPI or AutoEntryScript somewhere up the stack, right?
Hmm. There's an AutoSafeJSContext, right. Great.
> |rootedSandbox| is an unused variable now -- remove it.
Done.
Assignee | ||
Comment 16•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/92ff2fa07cf0
https://hg.mozilla.org/integration/mozilla-inbound/rev/975552180fb6
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c1eafe518d0
https://hg.mozilla.org/integration/mozilla-inbound/rev/f642c3fe61bd
https://hg.mozilla.org/integration/mozilla-inbound/rev/2a3c79f06c22
https://hg.mozilla.org/integration/mozilla-inbound/rev/cf1fb1365dd9
https://hg.mozilla.org/integration/mozilla-inbound/rev/702b075ca1e6
Comment 17•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/92ff2fa07cf0
https://hg.mozilla.org/mozilla-central/rev/975552180fb6
https://hg.mozilla.org/mozilla-central/rev/9c1eafe518d0
https://hg.mozilla.org/mozilla-central/rev/f642c3fe61bd
https://hg.mozilla.org/mozilla-central/rev/2a3c79f06c22
https://hg.mozilla.org/mozilla-central/rev/cf1fb1365dd9
https://hg.mozilla.org/mozilla-central/rev/702b075ca1e6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•