-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11966 from ef4/meta-sanity
[BUGFIX canary] Meta refactor
- Loading branch information
Showing
36 changed files
with
730 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This exists because `Object.create(null)` is absurdly slow compared | ||
// to `new EmptyObject()`. In either case, you want a null prototype | ||
// when you're treating the object instances as arbitrary dictionaries | ||
// and don't want your keys colliding with build-in methods on the | ||
// default object prototype. | ||
|
||
var proto = Object.create(null, { | ||
// without this, we will always still end up with (new | ||
// EmptyObject()).constructor === Object | ||
constructor: { | ||
value: undefined, | ||
enumerable: false, | ||
writable: true | ||
} | ||
}); | ||
|
||
function EmptyObject() {} | ||
EmptyObject.prototype = proto; | ||
export default EmptyObject; |
Oops, something went wrong.
@stefanpenner I thought you removed delete here I thought we just set to undefined?