Skip to content

EnvDeleter should return true #7960

@iamstolis

Description

@iamstolis
  • Version: 6.2.2
  • Platform: Linux/Ubuntu
  • Subsystem: process.env

Consider the following test-case:

'use strict';
console.log(delete process.env.NON_EXISTING_VARIABLE);

It is weird to see delete operator to return false it strict-mode. It should return true or throw an error there. While this seems to be also a bug in V8 (it should throw an error when the deleter callback returns false in strict-mode) the implementation of EnvDeleter (in src/node.cc) should be fixed as well. It should return true for any environment variable (even the non-existing ones) to match the behaviour of delete operator that is supposed to return true unless non-configurable property is being deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions