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

Cleanup for 254593fd1d09e79049692675a4f9b7b5108b36d8 #94

Merged
merged 1 commit into from Dec 22, 2015

Conversation

@arb
Copy link
Contributor

arb commented Dec 22, 2015

- Closes #93
- Closes #92
@arb arb added this to the 3.1.0 milestone Dec 22, 2015
arb added a commit that referenced this pull request Dec 22, 2015
Cleanup for 254593f
@arb arb merged commit d9bce89 into hapijs:master Dec 22, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@arb arb deleted the arb:451 branch Dec 22, 2015
@AdriVanHoudt

This comment has been minimized.

Copy link

AdriVanHoudt commented on lib/index.js in 11b9211 Dec 22, 2015

What does this do?

const internals = {};
const internals = {
STATUS_CODES: {
__proto__: null,

This comment has been minimized.

Copy link
@devinivy

devinivy Dec 22, 2015

Member

What does this do?

This comment has been minimized.

Copy link
@arb

arb Dec 22, 2015

Author Contributor

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer "Prototype mutation".

Makes it so it's a real dictionary instead of a generic JS object. Doesn't have things like hasOwnProperty.

This comment has been minimized.

Copy link
@AdriVanHoudt

AdriVanHoudt Dec 23, 2015

Contributor

so it makes it faster?

This comment has been minimized.

Copy link
@Marsup

Marsup Dec 23, 2015

Member

Probably very slightly because you don't have to look up the prototype chain for misses but that should negligible.That's usually for security, might have seen it as Object.create(null) before.

This comment has been minimized.

Copy link
@AdriVanHoudt

AdriVanHoudt Dec 23, 2015

Contributor

Security? And thanks for the info, was thinking of why not a map but read up on mdn and this approach does seem better for this use case.

This comment has been minimized.

Copy link
@devinivy

devinivy Dec 23, 2015

Member

Why not use setPrototypeOf()? I thought __proto__ was legacy as of ES6.

This comment has been minimized.

Copy link
@Marsup
'415': 'Unsupported Media Type',
'416': 'Requested Range Not Satisfiable',
'417': 'Expectation Failed',
'418': `I'm a teapot`,

This comment has been minimized.

Copy link
@mtharrison

This comment has been minimized.

Copy link
@AdriVanHoudt

AdriVanHoudt Dec 23, 2015

Contributor

🍵

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.