The functions executed from the command line shows internal errors (or looks discarded) #7923

Closed
sdavidg opened this Issue Jul 20, 2015 · 6 comments

Projects

None yet

4 participants

@sdavidg
Contributor
sdavidg commented Jul 20, 2015
  1. create a file:
<html>
<head>
<title>The functions executed from the command line shows internal errors</title>
<script>
function x(){
    var a = "";
    console.log(a.a.a.a.a);
}
</script>       
</head>
<body>
<a href="javascript:x()">Click me!</a>
</body>
</html>
  1. Enable Script panel
  2. Switch to Console panel

Case 1:
1) click on "Click me!"
2) The console panel claims "TypeError: a.a is undefined" -> OK
Case 2:
1) Open the Command Editor and type: "x()"
2) Hit "Enter
3) The console panel claims:
Error: Permission denied to access property "defineGetter"
chrome://firebug/content/console/commandLineExposed.js (línea 492, col 12)

FF 39.0
Fb 2.0.11

David

@fflorent
Member

Thanks for the report David!

Indeed, I can reproduce this issue. That's something we have to fix.

Florent

2015-07-20 9:20 GMT+02:00 David notifications@github.com:

  1. create a file:
<title>The functions executed from the command line shows internal errors</title><script>function x(){ var a = ""; console.log(a.a.a.a.a);}</script> Click me!
  1. Enable Script panel
  2. Switch to Console panel

Case 1:

  1. click on "Click me!"
  2. The console panel claims "TypeError: a.a is undefined" -> OK
    Case 2:
  3. Open the Command Editor and type: "x()"
  4. Hit "Enter
  5. The console panel claims:
    Error: Permission denied to access property "defineGetter"
    chrome://firebug/content/console/commandLineExposed.js (línea 492, col 12)

FF 39.0
Fb 2.0.11

David


Reply to this email directly or view it on GitHub
#7923.

@fflorent
Member
fflorent commented Aug 5, 2015

@janodvarko the commit above (4ee3493) fixes the issue for some reasons (is that an issue with the compartments?). But I am not really sure it is safe. Do you mind reviewing?

Florent

@simonlindholm
Member

The issue here seems to be that https://bugzilla.mozilla.org/show_bug.cgi?id=837630 added __proto__ to Object.getOwnPropertyNames(Object.prototype), and thus the error modification loop changes the prototype of the newly created privileged Error object to some random unprivileged object, and weird things start to happen. So a more proper fix would be to add

if (prop === "__proto__")
    return;

to the forEach loop, or something in that vein.

@fflorent
Member
fflorent commented Aug 5, 2015

Haha, very well done! Yes, that's seems to be that :). Thanks a lot, the patch is updated.

@janodvarko Should I merge it into master?

Florent

@janodvarko
Member

Nice catch, yes please merge.

@fflorent Do you see any other blockers?
Can I go ahead and upload 2.0.12 for review?

Honza

@fflorent
Member
fflorent commented Aug 6, 2015

Merged.

Can I go ahead and upload 2.0.12 for review?

Sebastian has raised another issue, this time with Firefox 41 in the last comment of issue 7918 (#7918 (comment) ). I would say it is worth to include a fix for this.

Florent

@fflorent fflorent closed this Aug 6, 2015
@fflorent fflorent changed the title from The functions executed from the command line shows internal errors to The functions executed from the command line shows internal errors (or appears discarded) Aug 25, 2015
@fflorent fflorent changed the title from The functions executed from the command line shows internal errors (or appears discarded) to The functions executed from the command line shows internal errors (or looks discarded) Aug 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment