htmlbars icon indicating copy to clipboard operation
htmlbars copied to clipboard

Syntax Error in Android Browser API Level <= 15

Open davidgoli opened this issue 9 years ago • 5 comments

Admittedly this is an older browser, affecting as of this writing 8% of the Android market, but I thought I'd submit this for the record:

  • open an HTMLBars-dependent client app (eg. an Ember CLI >= 1.13 app) in an Android browser running API level 15 or below (aka Ice Cream Sandwich, v4.0.4) - including an emulator

result: JavaScript syntax error: "Unexpected strict mode reserved word"

The web app fails to continue to load and will not run, thus making it unusable for users of devices at this API level.

Tracked the offending line down to: https://github.com/tildeio/htmlbars/blob/0d883d7dba4e4e7dc476dd7b46a45781a05b6665/packages/htmlbars-runtime/lib/hooks.js#L107

Related issue: https://github.com/cujojs/when/issues/89

Does not repro on Android browsers >= API level 16.

davidgoli avatar Sep 30 '15 21:09 davidgoli

Would you mind sending in a PR quoting 'yield'?

rwjblue avatar Sep 30 '15 21:09 rwjblue

Done. Hopefully uglifiers won't strip the quotes...

davidgoli avatar Sep 30 '15 21:09 davidgoli

Shouldn't babel be handling this?

mmun avatar Sep 30 '15 21:09 mmun

I can confirm that this change does indeed fix this issue.

davidgoli avatar Sep 30 '15 22:09 davidgoli

But it does seem like a nice-to-have for the Babel processor.

davidgoli avatar Sep 30 '15 22:09 davidgoli