Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(globals): add common browser extension namespaces as globals #1224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading