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

binding to a builtin name fails cryptically #510

Closed
dagitses opened this issue May 20, 2014 · 11 comments
Closed

binding to a builtin name fails cryptically #510

dagitses opened this issue May 20, 2014 · 11 comments

Comments

@dagitses
Copy link

Example:
<template repeat="{{dir in [1, 2, 3]}}">{{dir}}</template> => 333

I scratched my head on this one for a very long time before I realized that dir() is some kind of special value, at least in Chrome.

Apologies for the imprecision, I don't know the status of "dir" in Javascript, i.e. is it just in Chrome, is it a builtin? Nevertheless, it exhibits this really unfortunate behavior.

Is is possible to detect such uses, or to make them work as intended?

http://jsbin.com/polojite/1/edit

@ebidel
Copy link
Contributor

ebidel commented May 20, 2014

Sorry, that's definitely a head scratcher. We should probably throw a warning for cases like this.

I believe it's part of the Console API (console.dir): https://developer.chrome.com/devtools/docs/console-api#consoledirobject

@sjmiles
Copy link
Contributor

sjmiles commented May 20, 2014

'dir' specifies directionality ('rtl' or 'auto') for HTMLElement:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement.dir

On Tue, May 20, 2014 at 9:17 AM, Eric Bidelman notifications@github.comwrote:

Sorry, that's definitely a head scratcher. We should probably throw a
warning for cases like this.

I believe it's part of the Console API (console.dir):
https://developer.chrome.com/devtools/docs/console-api#consoledirobject


Reply to this email directly or view it on GitHubhttps://github.com//issues/510#issuecomment-43647828
.

@ebidel
Copy link
Contributor

ebidel commented May 20, 2014

Ah yes. Related: #123

@dagitses
Copy link
Author

Edit: removed. I may be wrong.

@dagitses
Copy link
Author

Removed previous comment, I probably misdiagnosed the issue.

@sjmiles
Copy link
Contributor

sjmiles commented May 20, 2014

This sounds like #123, but it's not. This variable dir should be distinct from any prototype, I believe this is a bug in TemplateBinding. I'm working on a reduction and an issue ticket.

@sjmiles
Copy link
Contributor

sjmiles commented May 20, 2014

Not TemplateBinding, rather polymer-expressions.

@ebidel
Copy link
Contributor

ebidel commented May 20, 2014

Thanks @sjmiles.

@sjmiles
Copy link
Contributor

sjmiles commented May 20, 2014

@dagitses
Copy link
Author

Thanks for the quick triage.

@sorvell
Copy link
Contributor

sorvell commented Aug 12, 2014

Closing since the root cause (googlearchive/polymer-expressions#33) has been fixed.

@sorvell sorvell closed this as completed Aug 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants