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

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

This comment has been minimized.

Show comment
Hide comment
@fflorent

fflorent Jul 21, 2015

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.

Member

fflorent commented Jul 21, 2015

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

This comment has been minimized.

Show comment
Hide comment
@fflorent

fflorent Aug 5, 2015

Member

@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

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

This comment has been minimized.

Show comment
Hide comment
@simonlindholm

simonlindholm Aug 5, 2015

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.

Member

simonlindholm commented Aug 5, 2015

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

This comment has been minimized.

Show comment
Hide comment
@fflorent

fflorent Aug 5, 2015

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@janodvarko

janodvarko Aug 6, 2015

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

Member

janodvarko commented Aug 6, 2015

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

This comment has been minimized.

Show comment
Hide comment
@fflorent

fflorent Aug 6, 2015

Member

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

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