1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Refactor assets bundler and split Javascript files

This commit is contained in:
Frédéric Guillot 2018-07-05 22:18:51 -07:00
parent e1c56b2e53
commit 53deb0b8cd
49 changed files with 2837 additions and 2000 deletions

View file

@ -20,7 +20,7 @@ func TestTokens(t *testing.T) {
{"\n\r\r\n\u2028\u2029", TTs{LineTerminatorToken}},
{"5.2 .04 0x0F 5e99", TTs{NumericToken, NumericToken, NumericToken, NumericToken}},
{"a = 'string'", TTs{IdentifierToken, PunctuatorToken, StringToken}},
{"/*comment*/ //comment", TTs{CommentToken, CommentToken}},
{"/*comment*/ //comment", TTs{SingleLineCommentToken, SingleLineCommentToken}},
{"{ } ( ) [ ]", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken}},
{". ; , < > <=", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken}},
{">= == != === !==", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken}},
@ -31,12 +31,12 @@ func TestTokens(t *testing.T) {
{">>= >>>= &= |= ^= =>", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken}},
{"a = /.*/g;", TTs{IdentifierToken, PunctuatorToken, RegexpToken, PunctuatorToken}},
{"/*co\nm\u2028m/*ent*/ //co//mment\u2029//comment", TTs{CommentToken, CommentToken, LineTerminatorToken, CommentToken}},
{"/*co\nm\u2028m/*ent*/ //co//mment\u2029//comment", TTs{MultiLineCommentToken, SingleLineCommentToken, LineTerminatorToken, SingleLineCommentToken}},
{"<!-", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken}},
{"1<!--2\n", TTs{NumericToken, CommentToken, LineTerminatorToken}},
{"1<!--2\n", TTs{NumericToken, SingleLineCommentToken, LineTerminatorToken}},
{"x=y-->10\n", TTs{IdentifierToken, PunctuatorToken, IdentifierToken, PunctuatorToken, PunctuatorToken, NumericToken, LineTerminatorToken}},
{" /*comment*/ -->nothing\n", TTs{CommentToken, CommentToken, LineTerminatorToken}},
{"1 /*comment\nmultiline*/ -->nothing\n", TTs{NumericToken, CommentToken, CommentToken, LineTerminatorToken}},
{" /*comment*/ -->nothing\n", TTs{SingleLineCommentToken, SingleLineCommentToken, LineTerminatorToken}},
{"1 /*comment\nmultiline*/ -->nothing\n", TTs{NumericToken, MultiLineCommentToken, SingleLineCommentToken, LineTerminatorToken}},
{"$ _\u200C \\u2000 \u200C", TTs{IdentifierToken, IdentifierToken, IdentifierToken, UnknownToken}},
{">>>=>>>>=", TTs{PunctuatorToken, PunctuatorToken, PunctuatorToken}},
{"1/", TTs{NumericToken, PunctuatorToken}},
@ -63,7 +63,7 @@ func TestTokens(t *testing.T) {
{"'\n '\u2028", TTs{UnknownToken, LineTerminatorToken, UnknownToken, LineTerminatorToken}},
{"'str\\\U00100000ing\\0'", TTs{StringToken}},
{"'strin\\00g'", TTs{StringToken}},
{"/*comment", TTs{CommentToken}},
{"/*comment", TTs{SingleLineCommentToken}},
{"a=/regexp", TTs{IdentifierToken, PunctuatorToken, RegexpToken}},
{"\\u002", TTs{UnknownToken, IdentifierToken}},
@ -97,6 +97,9 @@ func TestTokens(t *testing.T) {
{"function f(){}/1/g", TTs{IdentifierToken, IdentifierToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, PunctuatorToken, RegexpToken}},
{"this.return/1/g", TTs{IdentifierToken, PunctuatorToken, IdentifierToken, PunctuatorToken, NumericToken, PunctuatorToken, IdentifierToken}},
{"(a+b)/1/g", TTs{PunctuatorToken, IdentifierToken, PunctuatorToken, IdentifierToken, PunctuatorToken, PunctuatorToken, NumericToken, PunctuatorToken, IdentifierToken}},
{"`\\``", TTs{TemplateToken}},
{"`\\${ 1 }`", TTs{TemplateToken}},
{"`\\\r\n`", TTs{TemplateToken}},
// go fuzz
{"`", TTs{UnknownToken}},