efront 4.0.20 → 4.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coms/basic/queue.js +3 -2
- package/coms/basic_/Symbol.js +2 -2
- package/coms/basic_/aster_.js +6 -6
- package/coms/basic_/asyncAster_.js +19 -13
- package/coms/basic_/exec_.js +21 -5
- package/coms/compile/Javascript.js +70 -30
- package/coms/compile/Program.js +13 -6
- package/coms/compile/common.js +76 -79
- package/coms/compile/downLevel.js +251 -100
- package/coms/compile/downLevel_test.js +55 -31
- package/coms/compile/run-test262.js +141 -0
- package/coms/compile/unstruct.js +42 -40
- package/coms/compile/unstruct_test.js +10 -5
- package/coms/kugou/dance.js +1 -0
- package/coms/kugou/player.js +4 -27
- package/coms/reptile/colored_console.js +9 -9
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/kugou/player.js
CHANGED
|
@@ -187,7 +187,6 @@ var $scope = {
|
|
|
187
187
|
if (inc !== false) ++this.playid;
|
|
188
188
|
$scope.playing = false;
|
|
189
189
|
let _audio = $scope.audio;
|
|
190
|
-
ns.disable();
|
|
191
190
|
if (_audio && _audio.pause instanceof Function) _audio.pause();
|
|
192
191
|
render.refresh();
|
|
193
192
|
},
|
|
@@ -196,7 +195,7 @@ var $scope = {
|
|
|
196
195
|
select(elem, $scope.activeList, null);
|
|
197
196
|
},
|
|
198
197
|
draw(buf) {
|
|
199
|
-
if (!player || !player.offsetHeight || !$scope.dance) return;
|
|
198
|
+
if (!player || !player.offsetHeight || !$scope.dance) return cast($scope.dance, { theta: $scope.quickTheta || 0 });
|
|
200
199
|
buf = Array.prototype.map.call(buf, a => (a / 128.0 - 1) * 2 / 9 + 0.6);
|
|
201
200
|
var width = freePixel(player.offsetWidth);
|
|
202
201
|
var height = 72;
|
|
@@ -258,7 +257,6 @@ var $scope = {
|
|
|
258
257
|
$scope.playing = true;
|
|
259
258
|
let _audio = $scope.audio;
|
|
260
259
|
if (_audio.play instanceof Function) {
|
|
261
|
-
if (ns.wake) ns.enable();
|
|
262
260
|
_audio.play();
|
|
263
261
|
}
|
|
264
262
|
return;
|
|
@@ -275,23 +273,18 @@ var $scope = {
|
|
|
275
273
|
* @type {HTMLAudioElement}
|
|
276
274
|
*/
|
|
277
275
|
var _audio = document.createElement("audio");
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
};
|
|
281
|
-
if (hasContext) {
|
|
282
|
-
// ios设备目前未找到可视化方案
|
|
276
|
+
if (hasContext && !/iPhone/.test(navigator.userAgent)) {
|
|
277
|
+
// ios设备添加可视化后,无法背景播放
|
|
283
278
|
var context = new AudioContext;
|
|
284
279
|
var source = context.createMediaElementSource(_audio);
|
|
285
280
|
analyser = context.createAnalyser();
|
|
286
281
|
analyser.fftSize = dancingArray.length;
|
|
287
282
|
source.connect(analyser);
|
|
288
|
-
_audio.crossOrigin = "anonymous";
|
|
289
|
-
source.crossOrigin = 'anonymous';
|
|
290
283
|
source.connect(context.destination);
|
|
284
|
+
_audio.crossOrigin = "anonymous";
|
|
291
285
|
}
|
|
292
286
|
if (_audio.play) {
|
|
293
287
|
_audio.ontimeupdate = $scope.update;
|
|
294
|
-
if (ns.wake) ns.enable();
|
|
295
288
|
_audio.play();//安卓4以上的播放功能要在用户事件中调用;
|
|
296
289
|
} else {
|
|
297
290
|
// <embed id="a_player_ie8" type="audio/mpeg" src="a.mp3" autostart="false"></embed>
|
|
@@ -327,10 +320,8 @@ var $scope = {
|
|
|
327
320
|
if ($scope.audio === _audio) {
|
|
328
321
|
playState.error = true;
|
|
329
322
|
}
|
|
330
|
-
if (ns) ns.disable();
|
|
331
323
|
};
|
|
332
324
|
delete playState.error;
|
|
333
|
-
if (ns.wake) ns.enable();
|
|
334
325
|
_audio.src = hasContext && music.type !== "qqjt" ? cross.getCrossUrl(response.url) : response.url;
|
|
335
326
|
_audio.play();
|
|
336
327
|
data.setInstance('musicList', distlist, true);
|
|
@@ -435,20 +426,6 @@ var createControls = function () {
|
|
|
435
426
|
return player;
|
|
436
427
|
};
|
|
437
428
|
var ns = document.addEventListener && new thirdParty$NoSleep;
|
|
438
|
-
data.bindInstance("play-mode", function (e) {
|
|
439
|
-
if (!ns) return;
|
|
440
|
-
if (e.wake) {
|
|
441
|
-
ns.wake = true;
|
|
442
|
-
if ($scope.playing) {
|
|
443
|
-
$scope.pause();
|
|
444
|
-
$scope.play();
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
else if (ns) {
|
|
448
|
-
ns.wake = false;
|
|
449
|
-
ns.disable();
|
|
450
|
-
}
|
|
451
|
-
});
|
|
452
429
|
|
|
453
430
|
var player = function (player) {
|
|
454
431
|
render(player, $scope);
|
|
@@ -97,10 +97,10 @@ var write = function (hasNewLine, str) {
|
|
|
97
97
|
bgColor = colors[bg] || "",
|
|
98
98
|
reset = colors.Reset;
|
|
99
99
|
var hasNewLine = /^(warn|error|pass|fail)$/.test(log);
|
|
100
|
-
var logger = function (
|
|
100
|
+
var logger = function () {
|
|
101
101
|
var label = fgColor + bgColor + info + reset;
|
|
102
102
|
var time_stamp = '';
|
|
103
|
-
var str = [time_stamp, label
|
|
103
|
+
var str = [time_stamp, label].concat(Array.prototype.map.call(arguments, a => renderColor(a))).join(" ");
|
|
104
104
|
write1(hasNewLine, str);
|
|
105
105
|
};
|
|
106
106
|
colored[log] = logger;
|
|
@@ -120,7 +120,7 @@ var formatRows = function (arg, rows, deep, entry, leave) {
|
|
|
120
120
|
var space = new Array(deep).join(" ");
|
|
121
121
|
var deepspace = new Array(deep + 1).join(" ");
|
|
122
122
|
var lens = rows.slice(0, 100).map(r => r.replace(colorReg, '').replace(/[\u00ff-\uffff]/g, '00').length);
|
|
123
|
-
var maxLength = Math.max(
|
|
123
|
+
var maxLength = Math.max.apply(Math, lens) + 2;
|
|
124
124
|
var itemcount = (process.stdout.columns - deepspace.length - 10) / maxLength | 0;
|
|
125
125
|
if (rows.length > itemcount) {
|
|
126
126
|
if (itemcount * itemcount > rows.length + process.stdout.columns) itemcount = Math.ceil(Math.sqrt(rows.length + process.stdout.columns));
|
|
@@ -162,9 +162,9 @@ var formatRows = function (arg, rows, deep, entry, leave) {
|
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
164
|
for (var cx = 0, dx = rows.length; cx < dx; cx += itemcount) {
|
|
165
|
-
res.push([rows[cx]
|
|
165
|
+
res.push([rows[cx]].concat(rows.slice(cx + 1, cx + itemcount).map((r, i) => {
|
|
166
166
|
return Array(Math.max(maxLength[i] - lens[cx + i], 0)).join(" ") + r;
|
|
167
|
-
})
|
|
167
|
+
})).join(', '));
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -265,11 +265,11 @@ colored.time = function (date = new Date, str) {
|
|
|
265
265
|
write1(true, colors.BgGray + colors.FgWhite2 + formatDate.call(date) + str + colors.Reset);
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
-
colored.type = function (
|
|
269
|
-
write1(false,
|
|
268
|
+
colored.type = function () {
|
|
269
|
+
write1(false, Array.prototype.map.call(arguments, a => format(a)).join(' '));
|
|
270
270
|
};
|
|
271
|
-
colored.line = function (
|
|
272
|
-
write1(true,
|
|
271
|
+
colored.line = function () {
|
|
272
|
+
write1(true, Array.prototype.map.call(arguments, a => format(a)).join(' '));
|
|
273
273
|
};
|
|
274
274
|
var _log = console.log;
|
|
275
275
|
colored.log = function () {
|