Skip to content

amp-ad behavior with primitive json attribute #29839

@samouri

Description

@samouri

summary

<amp-ad> accepts an optional json attribute. Some websites provide a string in that attribute which is technically valid json (as would be a number). This becomes a problem when attempting to assign to a property of jsonTargeting. It fails silently in sloppy mode, but will throw in both esm and strict mode.

this.jsonTargeting['targeting'] = !!this.jsonTargeting['targeting']

@keithwrightbos: Do you know what the behavior should be in the case of a string json value? (or any non truthy non-object for that matter).

Metadata

Metadata

Assignees

Labels

StaleInactive for one year or moreType: Bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions