Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@sdavidg
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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
Copy link
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 as completed Aug 6, 2015
@fflorent fflorent changed the title The functions executed from the command line shows internal errors The functions executed from the command line shows internal errors (or appears discarded) Aug 25, 2015
@fflorent fflorent changed the title The functions executed from the command line shows internal errors (or appears discarded) 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
Projects
None yet
Development

No branches or pull requests

4 participants