question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amp-state ids collide with reserved words when called from amp-list template

See original GitHub issue

What’s the issue?

amp-state ids collide with reserved words when called from amp-list template

How do we reproduce the issue?

  1. Create an amp-state with an id of formData
  2. Attempt to do anything that calls AMP.setState on formData from within an amp-list and template component

👉 Bug Demo Here

What browsers are affected?

Only tested in Chrome and Safari

Which AMP version is affected?

1516833286380

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sebastianbenzcommented, Jan 31, 2018

Thanks @choumx for looking into this. Warning/error on console would be great - this is super frustrating to debug otherwise.

0reactions
dreamofabearcommented, Jan 30, 2018

This is where the on attribute gets stripped (and where we should add a user warning/error): https://github.com/ampproject/amphtml/blob/0cef5ae4ca934faa212fd09a485519430dbf6499/src/sanitizer.js#L380-L387

You can check the element inspector of Chrome devtools to see.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Using reserved words as property names, revisited
In ECMAScript, starting from ES5, reserved words may be used as object property names "in the buff". This means that they don't need...
Read more >
Reserved keywords - Amazon Athena - AWS Documentation
Athena uses the following list of reserved keywords in SQL SELECT statements and in queries on views. If you use these keywords as...
Read more >
Documentation: <amp-list> - amp.dev
Dynamically downloads data and creates list items using a template. ... The amp-list component fetches dynamic content from a CORS JSON endpoint.
Read more >
How to name something when the logical option is a reserved ...
For an enum option you should use title case like Default . Since C# is case-sensitive it will not collide with the reserved...
Read more >
Reserved schema names and reserved words - IBM
In such cases, the word must be specified as a delimited identifier. For example, COUNT cannot be used as a column name in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found