Skip to content

Proxy get handler is used when evaluating the proxy #16483

Closed
@kuanee

Description

@kuanee
  • Version: v8.7.0

The defined 'not ready' error is raised when evaluating the proxy. This error does not occur in chrome or firefox consoles.

const o1 = {
      ready: false
    };

setTimeout(() => {
  o1.ready = true;
}, 1000000000);

const handler = {
  get(target, propKey, receiver) {
    if (target.ready == false) {
      throw new Error('not ready');
    } else {
      return 'ready'
    }
  }
};

const proxy = new Proxy(o1, handler);

proxy; // raises 'not ready'

Metadata

Metadata

Assignees

No one assigned

    Labels

    replIssues and PRs related to the REPL subsystem.utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions