@krx3d/tizentube2 1.31.760 → 1.31.770
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krx3d/tizentube2",
|
|
3
3
|
"appName": "TizenTube",
|
|
4
|
-
"version": "1.31.
|
|
4
|
+
"version": "1.31.770",
|
|
5
5
|
"description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.",
|
|
6
6
|
"packageType": "mods",
|
|
7
7
|
"websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Compiles built bundles with the V8 that actually runs them, without
|
|
2
|
+
// executing them, and fails on the first SyntaxError. CI-only, nothing here
|
|
3
|
+
// ends up on the TV. Run it with an old Node so its V8 is the parser under
|
|
4
|
+
// test (see .github/workflows/runtime-syntax-check.yml):
|
|
5
|
+
//
|
|
6
|
+
// node --nolazy check-syntax.js --module dist/service.js (Node 4.4.3)
|
|
7
|
+
// node --nolazy --harmony_rest_parameters check-syntax.js --script dist/userScript.js (Node 5.12)
|
|
8
|
+
//
|
|
9
|
+
// --script compiles the file as a classic script (how the userscript is
|
|
10
|
+
// injected into the page). --module wraps it the way require() does first,
|
|
11
|
+
// so the parse is the same one a service runtime does at require time.
|
|
12
|
+
// --nolazy makes V8 fully parse every function body up front; otherwise
|
|
13
|
+
// errors inside functions only surface when they are first called.
|
|
14
|
+
//
|
|
15
|
+
// Plain ES5 on purpose: this file itself has to parse on Node 4.
|
|
16
|
+
|
|
17
|
+
'use strict';
|
|
18
|
+
|
|
19
|
+
var fs = require('fs');
|
|
20
|
+
var vm = require('vm');
|
|
21
|
+
var Module = require('module');
|
|
22
|
+
var childProcess = require('child_process');
|
|
23
|
+
|
|
24
|
+
var mode = null;
|
|
25
|
+
var failed = 0;
|
|
26
|
+
var checked = 0;
|
|
27
|
+
|
|
28
|
+
function compile(file, asModule) {
|
|
29
|
+
var source = fs.readFileSync(file, 'utf8');
|
|
30
|
+
// eslint-disable-next-line no-new
|
|
31
|
+
new vm.Script(asModule ? Module.wrap(source) : source, { filename: file });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Old Node keeps the position of a caught compile error to itself (the stack
|
|
35
|
+
// only names the caller); it prints "file:line", the source line and a caret
|
|
36
|
+
// only when the error goes uncaught. So compile again in a child, uncaught,
|
|
37
|
+
// and read the position from its stderr.
|
|
38
|
+
function locate(file, asModule) {
|
|
39
|
+
var args = process.execArgv.concat([__filename, '--locate', asModule ? '--module' : '--script', file]);
|
|
40
|
+
var result = childProcess.spawnSync(process.execPath, args, { encoding: 'utf8', maxBuffer: 256 * 1024 * 1024 });
|
|
41
|
+
var lines = String(result.stderr || '').split('\n');
|
|
42
|
+
var head = /:(\d+)$/.exec(lines[0] || '');
|
|
43
|
+
var caret = (lines[2] || '').indexOf('^');
|
|
44
|
+
if (!head || caret < 0) return null;
|
|
45
|
+
var line = Number(head[1]);
|
|
46
|
+
if (asModule && line === 1) caret -= Module.wrapper[0].length;
|
|
47
|
+
var text = fs.readFileSync(file, 'utf8').split('\n')[line - 1] || '';
|
|
48
|
+
var from = Math.max(0, caret - 100);
|
|
49
|
+
return 'line ' + line + ', column ' + (caret + 1) + ':\n ' +
|
|
50
|
+
text.slice(from, caret + 100) + '\n ' + new Array(caret - from + 1).join(' ') + '^';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function check(file, asModule) {
|
|
54
|
+
try {
|
|
55
|
+
compile(file, asModule);
|
|
56
|
+
checked++;
|
|
57
|
+
console.log('OK ' + file);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
failed++;
|
|
60
|
+
console.log('FAIL ' + file + ': ' + err);
|
|
61
|
+
var where = locate(file, asModule);
|
|
62
|
+
if (where) console.log(' at ' + where);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (process.argv[2] === '--locate') {
|
|
67
|
+
compile(process.argv[4], process.argv[3] === '--module');
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
process.argv.slice(2).forEach(function (arg) {
|
|
72
|
+
if (arg === '--script' || arg === '--module') {
|
|
73
|
+
mode = arg;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!mode) {
|
|
77
|
+
console.log('Usage: check-syntax.js (--script|--module) file... [(--script|--module) file...]');
|
|
78
|
+
process.exit(2);
|
|
79
|
+
}
|
|
80
|
+
check(arg, mode === '--module');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
console.log('Node ' + process.version + ' (V8 ' + process.versions.v8 + '): ' +
|
|
84
|
+
checked + ' passed, ' + failed + ' failed');
|
|
85
|
+
process.exit(failed || !checked ? 1 : 0);
|