Skip to content
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

avoid prototype builtin hasOwnProperty #2144

Merged
merged 2 commits into from
Apr 19, 2019

Conversation

justjavac
Copy link
Contributor

prototype builtin hasOwnProperty for two problems:

  1. if the object has a key named hasOwnProperty:

    const options = {"hasOwnProperty":"foo" };
    new Blob(["hello"], options);

    throw

    Uncaught TypeError: options.hasOwnProperty is not a function
        at DenoBlob (js/blob.ts:94:18)
        at <unknown>:1:1
        at evaluate (js/repl.ts:87:34)
        at replLoop (js/repl.ts:145:13)
    
  2. the object doesn't inherit from Object.prototype:

    const options = Object.create(null);
    new Blob(["hello"], options);

    throw

    Uncaught TypeError: options.hasOwnProperty is not a function
        at DenoBlob (js/blob.ts:94:18)
        at <unknown>:1:1
        at evaluate (js/repl.ts:87:34)
        at replLoop (js/repl.ts:145:13)
    

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks : )

@ry ry merged commit d0cd7a3 into denoland:master Apr 19, 2019
@justjavac justjavac deleted the no-prototype-builtin-hasownproperty branch April 19, 2019 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants