Closed
Bug 1217402
Opened 9 years ago
Closed 8 years ago
revert for-of loops, that they work well with Windows Phone 10
Categories
(L20n :: JS Library, defect)
L20n
JS Library
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: andre.fiedler, Unassigned)
Details
refering to /l20n.js-3.3.3/dist/compat/web/l20n.js
This translated line will not iterate on Windows Phone 10 devices (running inside "WebView"):
> for (var _iterator3 = metas, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
This is why it fails:
> var metas = head.querySelectorAll('meta[name="availableLanguages"],' + 'meta[name="defaultLanguage"],' + 'meta[name="appVersion"]');
>
> console.log(metas);
>
> // {"0":{},"1":{}}
>
> console.log(Array.isArray(metas));
>
> // false
This works so far:
> for (var i = 0; i < metas.length; i++) {
> console.log(metas[i].getAttribute('name'));
> }
> // defaultLanguage
> // availableLanguages
So the solution by now seems to require a re-write to "classic" for loops.
Reporter | ||
Comment 1•9 years ago
|
||
The "translated" code line above comes from this file line #16:
https://github.com/l20n/l20n.js/blob/15884660ab2e3850fc7a45a61723e9c6b782c827/src/bindings/html/langs.js#16
Comment 2•9 years ago
|
||
Is Windows Phone 10 on IE11 or Edge?
Reporter | ||
Comment 3•9 years ago
|
||
Let me explain a bit first ... ;)
Our firm currently is developing using the .NET framework version 4.5. That's because Windows Phone 10 is not yet released and 95% of our users is running Windows Phone 8.1. WP10 will be released in December (I think) for a limited batch of devices first. Let's see how fast it will catch up next year.
So by now we are stuck using the XAML "WebView" that comes with .NET 4.5 ... even if our app is running on Windows Phone 10 ... and that one states it is "IE Mobile 11" (what ever that means).
I think many other firms supporting WP will be also still using .NET 4.5. It takes some more time before we drop WP8.1 support (sadly). We dropped WP7 support just some months ago.
Is there any page that I can run in my Windows Phone "WebView" test app, that shows ES6 API support?
Just found this page, that does not mention IE Mobile 11:
https://kangax.github.io/compat-table/es6/
Reporter | ||
Comment 4•9 years ago
|
||
Btw., the real Browser in WP10 states it is "Edge 12" (don't know if it has all the Edge 12 features - could not imagine it ;) ).
But the "WebView" depends on the .NET framework version the app was written in.
Comment 5•8 years ago
|
||
We documented the browser compat story for our current code version on https://github.com/l20n/l20n.js/blob/master/docs/compat.md. I hope that works for you, not sure.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•