Skip to content

Commit 5c304d0

Browse files
author
Andy Hanson
committed
Remove createObject; use Object.create directly.
1 parent 55fc62b commit 5c304d0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/compiler/core.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ namespace ts {
2626
// More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times.
2727
export const collator: { compare(a: string, b: string): number } = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
2828

29-
const createObject = Object.create;
3029
/** Create a MapLike with good performance. Prefer this over a literal `{}`. */
3130
export function createMapLike<T>(): MapLike<T> {
32-
const map = createObject(null); // tslint:disable-line:no-null-keyword
31+
const map = Object.create(null); // tslint:disable-line:no-null-keyword
3332

3433
// Using 'delete' on an object causes V8 to put the object in dictionary mode.
3534
// This disables creation of hidden classes, which are expensive when an object is

0 commit comments

Comments
 (0)