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

dart2js produces code for window.location.hash that doesn't work in recent Firefox #3152

Closed
DartBot opened this issue May 20, 2012 · 11 comments
Closed
Assignees
Labels
Milestone

Comments

@DartBot
Copy link

@DartBot DartBot commented May 20, 2012

This issue was originally filed by akren...@gmail.com


What steps will reproduce the problem?

  1. open attached HTML file in recent Firefox (version 12 on OSX here)
  2. open console
  3. click any of the links
  4. observe error messages like "$.window().get$location().get$hash is not a function" in the error console

What is the expected output? What do you see instead?
Recent Chrome (19.0.1084.46 on OSX here) produces the correct output:
"hash = #foo"
"hash = #bar"

What version of the product are you using? On what operating system?
Firefox 12.0 (doesn't work), Chrome 19.0.1084.46 (works). Compiler is dart2js from latest unstable dart-macos.zip, downloaded May 18 14:43 MD5 sum db6e69f26ea92e9be5b709161f1b5556.

I attached both the dart source code and the compiled .dart.js file.


Attachments:
locationhash.html (231 Bytes)
locationhash.dart (142 Bytes)
locationhash.dart.js (104.62 KB)

@iposva-google
Copy link
Contributor

@iposva-google iposva-google commented May 21, 2012

Added Area-Dart2JS, Triaged labels.

Loading

@DartBot
Copy link
Author

@DartBot DartBot commented May 21, 2012

This comment was originally written by ngeoffray@google.com


Thanks Akrennmair for the bug report!

@stephen: I have investigated a bit, and it looks like the Location object in firefox does not get the properties patched on Object. Other objects like window do.


cc @rakudrama.
cc @kasperl.
Removed Area-Dart2JS label.
Added Area-DOM label.

Loading

@kasperl
Copy link

@kasperl kasperl commented May 24, 2012

Set owner to ngeoffray@google.com.
Removed Priority-Medium label.
Added Priority-High, Accepted labels.

Loading

@kasperl
Copy link

@kasperl kasperl commented May 25, 2012

Removed Area-DOM label.
Added Area-Dart2JS label.

Loading

@DartBot
Copy link
Author

@DartBot DartBot commented May 30, 2012

This comment was originally written by ngeoffray@google.com


Assigning to Stephen, because the generator for the dom/html libraries must be updated.


Set owner to @rakudrama.
Removed Area-Dart2JS label.
Added Area-DOM label.

Loading

@efortuna
Copy link
Contributor

@efortuna efortuna commented Jun 4, 2012

The Dromaeo benchmarks in samples/third_party/dromaeo also don't run because of this dart2js bug. Hope we can fix this soon.

Loading

@rakudrama
Copy link
Member

@rakudrama rakudrama commented Jun 5, 2012

Issue #1622 has been merged into this issue.

Loading

@rakudrama
Copy link
Member

@rakudrama rakudrama commented Jun 5, 2012

The FireFox Location object does not derive from JavaScript Object:

window.location.quux
undefined
document.body.quux
undefined
Object.prototype.quux = function(){return 123}
function()
document.body.quux
function()
document.body.quux()
123
window.location.quux
undefined

It is not possible to modify a Location's prototype either:

Object.getPrototypeOf(window.location)['peach'] = function(){return 'fuzz'}
Error: Illegal operation on WrappedNative prototype object
[Break On This Error]

I think we have no choice but to have a wrapper class for Location.

Loading

@DartBot
Copy link
Author

@DartBot DartBot commented Jun 8, 2012

This comment was originally written by ngeoffray@google.com


Issue #3443 has been merged into this issue.

Loading

@rakudrama
Copy link
Member

@rakudrama rakudrama commented Jun 11, 2012

Added this to the M1 milestone.

Loading

@rakudrama
Copy link
Member

@rakudrama rakudrama commented Jun 14, 2012

Fixed r8635


Added Fixed label.

Loading

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants