| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -927,7 +927,6 @@ | |||
| 927 | 927 | 'sources': [ | |
| 928 | 928 | '<@(node_sqlite_sources)', | |
| 929 | 929 | ], | |
| 930 | - 'defines': [ 'HAVE_SQLITE=1' ], | ||
| 931 | 930 | }], | |
| 932 | 931 | [ 'node_shared=="true" and node_module_version!="" and OS!="win"', { | |
| 933 | 932 | 'product_extension': '<(shlib_suffix)', | |
@@ -981,7 +980,6 @@ | |||
| 981 | 980 | 'sources': [ | |
| 982 | 981 | '<@(node_sqlite_sources)', | |
| 983 | 982 | ], | |
| 984 | - 'defines': [ 'HAVE_SQLITE=1' ], | ||
| 985 | 983 | }], | |
| 986 | 984 | [ 'OS in "linux freebsd mac solaris openharmony" and ' | |
| 987 | 985 | 'target_arch=="x64" and ' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -440,5 +440,10 @@ | |||
| 440 | 440 | }, { | |
| 441 | 441 | 'defines': [ 'HAVE_AMARO=0' ] | |
| 442 | 442 | }], | |
| 443 | + [ 'node_use_sqlite=="true"', { | ||
| 444 | + 'defines': [ 'HAVE_SQLITE=1' ], | ||
| 445 | + }, { | ||
| 446 | + 'defines': [ 'HAVE_SQLITE=0' ] | ||
| 447 | + }], | ||
| 443 | 448 | ], | |
| 444 | 449 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -350,8 +350,6 @@ const knownGlobals = new Set([ | |||
| 350 | 350 | 'CompressionStream', | |
| 351 | 351 | 'DecompressionStream', | |
| 352 | 352 | 'Storage', | |
| 353 | - 'localStorage', | ||
| 354 | - 'sessionStorage', | ||
| 355 | 353 | ].forEach((i) => { | |
| 356 | 354 | if (globalThis[i] !== undefined) { | |
| 357 | 355 | knownGlobals.add(globalThis[i]); | |
@@ -365,6 +363,11 @@ if (hasCrypto) { | |||
| 365 | 363 | knownGlobals.add(globalThis.SubtleCrypto); | |
| 366 | 364 | } | |
| 367 | 365 | ||
| 366 | + if (hasSQLite) { | ||
| 367 | + knownGlobals.add(globalThis.localStorage); | ||
| 368 | + knownGlobals.add(globalThis.sessionStorage); | ||
| 369 | + } | ||
| 370 | + | ||
| 368 | 371 | const { Worker } = require('node:worker_threads'); | |
| 369 | 372 | knownGlobals.add(Worker); | |
| 370 | 373 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,11 +12,14 @@ const { registerHooks } = require('module'); | |||
| 12 | 12 | ||
| 13 | 13 | const schemelessBlockList = new Set([ | |
| 14 | 14 | 'sea', | |
| 15 | - 'sqlite', | ||
| 16 | 15 | 'test', | |
| 17 | 16 | 'test/reporters', | |
| 18 | 17 | ]); | |
| 19 | 18 | ||
| 19 | + if (common.hasSQLite) { | ||
| 20 | + schemelessBlockList.add('sqlite'); | ||
| 21 | + } | ||
| 22 | + | ||
| 20 | 23 | const testModules = []; | |
| 21 | 24 | for (const mod of schemelessBlockList) { | |
| 22 | 25 | testModules.push(`node:${mod}`); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,11 +36,14 @@ hook.deregister(); | |||
| 36 | 36 | // stripped for internal lookups should not get passed into the hooks. | |
| 37 | 37 | const schemelessBlockList = new Set([ | |
| 38 | 38 | 'sea', | |
| 39 | - 'sqlite', | ||
| 40 | 39 | 'test', | |
| 41 | 40 | 'test/reporters', | |
| 42 | 41 | ]); | |
| 43 | 42 | ||
| 43 | + if (common.hasSQLite) { | ||
| 44 | + schemelessBlockList.add('sqlite'); | ||
| 45 | + } | ||
| 46 | + | ||
| 44 | 47 | const testModules = []; | |
| 45 | 48 | for (const mod of schemelessBlockList) { | |
| 46 | 49 | testModules.push(`node:${mod}`); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | const { skipIfSQLiteMissing } = require('../common/index.mjs'); | |
| 3 | 3 | const { test } = require('node:test'); | |
| 4 | 4 | const assert = require('node:assert'); | |
| 5 | - const { DatabaseSync } = require('node:sqlite'); | ||
| 6 | 5 | skipIfSQLiteMissing(); | |
| 6 | + const { DatabaseSync } = require('node:sqlite'); | ||
| 7 | 7 | ||
| 8 | 8 | function checkDefensiveMode(db) { | |
| 9 | 9 | function journalMode() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,7 @@ | |||
| 1 | 1 | 'use strict'; | |
| 2 | - require('../common'); | ||
| 2 | + const { skipIfSQLiteMissing } = require('../common'); | ||
| 3 | + skipIfSQLiteMissing(); | ||
| 4 | + | ||
| 3 | 5 | const assert = require('assert'); | |
| 4 | 6 | const { DatabaseSync } = require('node:sqlite'); | |
| 5 | 7 | const { test, beforeEach } = require('node:test'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + // Flags: --experimental-webstorage --localstorage-file=./test/fixtures/empty.js | ||
| 4 | + | ||
| 5 | + const { hasSQLite } = require('../common'); | ||
| 6 | + const assert = require('node:assert'); | ||
| 7 | + | ||
| 8 | + // Ensuring that `sessionStorage` is not a getter that throws when built without SQLite. | ||
| 9 | + assert.strictEqual(typeof sessionStorage, hasSQLite ? 'object' : 'undefined'); | ||
| 10 | + assert.strictEqual(Object.hasOwn(globalThis, 'sessionStorage'), hasSQLite); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ export interface ConfigBinding { | |||
| 8 | 8 | hasTracing: boolean; | |
| 9 | 9 | hasNodeOptions: boolean; | |
| 10 | 10 | hasInspector: boolean; | |
| 11 | + hasSQLite: boolean; | ||
| 11 | 12 | noBrowserGlobals: boolean; | |
| 12 | 13 | bits: number; | |
| 13 | 14 | getDefaultLocale(): string; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments