Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

scope names in expressions can collide with other references #33

Closed
sjmiles opened this issue May 20, 2014 · 4 comments
Closed

scope names in expressions can collide with other references #33

sjmiles opened this issue May 20, 2014 · 4 comments

Comments

@sjmiles
Copy link
Contributor

sjmiles commented May 20, 2014

Please update the issue title as needed, I'm not being super precise.

An expression like this

<polymer-element name="test-element" attributes="property">
<template>
  <template repeat="{{id in ['a', 'b', 'c']}}">

Throws or has unusual behavior when the alias variable (id in this case) corresponds to an HTMLElement built-in.

Repro: http://jsbin.com/wediq/2/edit

Fwiw, I've also seen alias variables affect an element's properties, but I didn't capture the details, I'm working on a repro.

@jmesserly
Copy link
Contributor

just a guess, it could be here:
https://github.com/Polymer/polymer-expressions/blob/master/src/polymer-expressions.js#L570

since it uses Object.create(parentScope) the proto might have a setter.

@arv
Copy link
Contributor

arv commented May 21, 2014

We could replace that with defineProperty but I'm not sure this is the real problem...

@rafaelw rafaelw changed the title alias variables in expressions can collide with other references scope names in expressions can collide with other references May 22, 2014
@rafaelw
Copy link
Contributor

rafaelw commented May 22, 2014

Yup. That sure looks like (at least one) problem.

@rafaelw
Copy link
Contributor

rafaelw commented May 22, 2014

Fixed in: 2edf01d

@rafaelw rafaelw closed this as completed May 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants