-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
src,lib,test: unflag --experimental-webstorage by default #57666
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
Changes from all commits
c68dd4c
c26b9a5
8c7f883
2103157
c9cda8f
8c6d177
ecc92a0
1fe9092
6764302
5cbf0ff
047d40f
a6648c5
c6693ea
96a7054
923d469
fab489d
67874b1
494a23d
39048d9
eff1a70
b17e1f5
07f19ba
7433905
3a4e2b5
a6ce8fd
ac15bcf
b9b8906
e7b8440
8e1972c
0ba26af
abe8491
4b152b1
890a794
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,13 @@ | ||
| 'use strict'; | ||
| const { | ||
| ObjectDefineProperties, | ||
| Proxy, | ||
| } = primordials; | ||
| const { ERR_INVALID_ARG_VALUE } = require('internal/errors').codes; | ||
| const { getOptionValue } = require('internal/options'); | ||
| const { emitExperimentalWarning } = require('internal/util'); | ||
| const { kConstructorKey, Storage } = internalBinding('webstorage'); | ||
| const { getValidatedPath } = require('internal/fs/utils'); | ||
| const kInMemoryPath = ':memory:'; | ||
|
|
||
| emitExperimentalWarning('Web Storage'); | ||
|
|
||
| module.exports = { Storage }; | ||
|
|
||
| let lazyLocalStorage; | ||
|
|
@@ -27,12 +24,31 @@ ObjectDefineProperties(module.exports, { | |
| const location = getOptionValue('--localstorage-file'); | ||
|
|
||
| if (location === '') { | ||
| throw new ERR_INVALID_ARG_VALUE('--localstorage-file', | ||
| location, | ||
| 'is an invalid localStorage location'); | ||
| } | ||
| let warningEmitted = false; | ||
| const handler = { | ||
| __proto__: null, | ||
| get(target, prop) { | ||
| if (!warningEmitted) { | ||
| process.emitWarning('`--localstorage-file` was provided without a valid path'); | ||
| warningEmitted = true; | ||
| } | ||
|
|
||
| return undefined; | ||
| }, | ||
| set(target, prop, value) { | ||
| if (!warningEmitted) { | ||
| process.emitWarning('`--localstorage-file` was provided without a valid path'); | ||
| warningEmitted = true; | ||
| } | ||
|
|
||
| lazyLocalStorage = new Storage(kConstructorKey, getValidatedPath(location)); | ||
| return false; | ||
| }, | ||
| }; | ||
|
|
||
| lazyLocalStorage = new Proxy({}, handler); | ||
| } else { | ||
| lazyLocalStorage = new Storage(kConstructorKey, getValidatedPath(location)); | ||
| } | ||
|
||
| } | ||
|
|
||
| return lazyLocalStorage; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.