-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Cannot delete property from process.env #27990
Comments
output on >>> plain object <<<
prop is not defined
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is declared as 1 with assignment (=)
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is configured as 1 with value
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is configured as 1 with getter|setter
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is redeclared as 1 with assignment (=)
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
>>> process.env <<<
prop is not defined
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is declared as 1 with assignment (=)
value "1"
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is configured as 1 with value
value "1"
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value undefined
hasProperty undefinedProp false
ownProperty undefinedProp false
prop is configured as 1 with getter|setter
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is redeclared as 1 with assignment (=)
value "1"
hasProperty undefinedProp true
ownProperty undefinedProp true
prop is deleted true
value 1
hasProperty undefinedProp true
ownProperty undefinedProp true
|
This seems to me to be correct. by default, values added using Object.defineProperty() are immutable. edited: should not return true(delete env[prop]). |
Fwiw, this is happening because the It’s not obvious to me what we should do when |
where is code related code? I couldn't find...😕 |
@himself65 It's here: Lines 397 to 399 in aa8b820
I agree with @addaleax that it's because of the missing That said, accessors or non-configurable/enumerable/writable properties aren't meaningful on |
yes, I think no one will add a changeable value on but, I'm trying to add something to fix it |
Configuring a property on the
process.env
object and deleting it results in weird behaviour.Documented in gist//60e654342532f80ae264128909e84198
curl -s https://gist.githubusercontent.com/iamogbz/60e654342532f80ae264128909e84198/raw/9329e2a1595b3b365d43ca5e59f242251df56f96/process.env.test.js | node
Seems like once a property has been configured with a
getter
setter
, then the property can never be truly deleted from theprocess.env
objectThe text was updated successfully, but these errors were encountered: