From 07d518ba16205e682bd344843c5ed86fe8897ae0 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Thu, 4 Apr 2024 14:13:36 +0800 Subject: [PATCH 01/31] Remove unused BadURLToken.tokenType --- parse-css.js | 1 - 1 file changed, 1 deletion(-) diff --git a/parse-css.js b/parse-css.js index bf5c79b..9d68d74 100644 --- a/parse-css.js +++ b/parse-css.js @@ -529,7 +529,6 @@ class BadURLToken extends CSSParserToken { } toSource() { return "url(BAD URL)"} } -BadURLToken.prototype.tokenType = "BADURL"; class WhitespaceToken extends CSSParserToken { constructor() { From fd5be0f15d21436ff0d38aad85cad9d1856497af Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 6 Apr 2024 00:38:12 +0800 Subject: [PATCH 02/31] Use 2-space indentation for printIndent() --- parse-css.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse-css.js b/parse-css.js index 9d68d74..d7654f8 100644 --- a/parse-css.js +++ b/parse-css.js @@ -1406,7 +1406,7 @@ class Func extends CSSParserRule { } function printIndent(level) { - return "\t".repeat(level); + return " ".repeat(level); } From 8eff20665ba45ecdc6113b6e19e3b8193208573c Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 6 Apr 2024 00:06:35 +0800 Subject: [PATCH 03/31] Separate test runner from test cases - Separate the test runner script to a new test.js file so that the developers of other projects can import and run the test cases on their own. --- test.html | 3 ++- test.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ tests.js | 56 ++++++++++--------------------------------------------- 3 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 test.js diff --git a/test.html b/test.html index 2edf653..0037aea 100644 --- a/test.html +++ b/test.html @@ -1,5 +1,6 @@ Tests +