Skip to content

Commit

Permalink
feat(globals): add common browser extension namespaces as globals
Browse files Browse the repository at this point in the history
  • Loading branch information
vegerot authored Aug 16, 2024
1 parent 456e774 commit 01c6868
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/quick-lint-js/fe/global-variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
QLJS_WARNING_IGNORE_GCC("-Wmissing-field-initializers")

namespace quick_lint_js {

// source: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Build_a_cross_browser_extension#api_namespace
constexpr const Char8 global_variables_browser_extensions[] =
u8"browser\0"
u8"chrome\0";

// Last updated: Bun v0.1.4
// Excludes ECMAScript globals.
constexpr const Char8 global_variables_bun[] =
Expand Down Expand Up @@ -464,6 +470,11 @@ const Global_Group global_groups[] = {
.type_only_globals = global_variables_web_types,
.globals_count = 990,
.type_only_globals_count = 515,
},
{
.name = u8"browser_extensions",
.globals = global_variables_browser_extensions,
.globals_count = 2,
},
{
.name = u8"bun",
Expand Down

0 comments on commit 01c6868

Please sign in to comment.