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
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Milestone

Comments

@DartBot
Copy link

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

Added Area-Dart2JS, Triaged labels.

@DartBot
Copy link
Author

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.

@kasperl
Copy link

kasperl commented May 24, 2012

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

@kasperl
Copy link

kasperl commented May 25, 2012

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

@DartBot
Copy link
Author

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.

@efortuna
Copy link
Contributor

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.

@rakudrama
Copy link
Member

Issue #1622 has been merged into this issue.

@rakudrama
Copy link
Member

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.

@DartBot
Copy link
Author

DartBot commented Jun 8, 2012

This comment was originally written by ngeoffray@google.com


Issue #3443 has been merged into this issue.

@rakudrama
Copy link
Member

Added this to the M1 milestone.

@rakudrama
Copy link
Member

Fixed r8635


Added Fixed label.

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures labels Jun 14, 2012
@DartBot DartBot added this to the M1 milestone Jun 14, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

5 participants