Skip to content

URL rewrite in templates#1645

Merged
dvoytenko merged 1 commit intoampproject:masterfrom
dvoytenko:templ-urlrepl
Jan 29, 2016
Merged

URL rewrite in templates#1645
dvoytenko merged 1 commit intoampproject:masterfrom
dvoytenko:templ-urlrepl

Conversation

@dvoytenko
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would generally be called #toString, so that coercion will work correctly:

var obj = {
  toString() { return 'test'; }
};
String(obj); // => 'test'
'' + obj; // => 'test'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like coercion to be honest. Usually I try to steer away. You feel strongly about it, I'll switch.

@dvoytenko
Copy link
Copy Markdown
Contributor Author

@cramforce changes have been made. PTAL.

@dvoytenko
Copy link
Copy Markdown
Contributor Author

@cramforce freundlich Ping!

src/sanitizer.js Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to document here why this is safe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I made it explicit to data:

@cramforce
Copy link
Copy Markdown
Member

LGTM with one comment. If the comment is correct. Otherwise not LGTM :)

dvoytenko added a commit that referenced this pull request Jan 29, 2016
@dvoytenko dvoytenko merged commit fa90642 into ampproject:master Jan 29, 2016
@dvoytenko dvoytenko deleted the templ-urlrepl branch January 29, 2016 21:57
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

Successfully merging this pull request may close these issues.

4 participants