From 2c3e9fbc07429a820bb9573900426b7b9f1568e3 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Sun, 14 Jun 2015 20:23:00 -0700 Subject: [PATCH] Initialize properties to avoid hidden class thrashing. --- src/babel/traversal/context.js | 1 + src/babel/traversal/path/index.js | 17 +++++++++++++++++ src/babel/traversal/scope/binding.js | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/src/babel/traversal/context.js b/src/babel/traversal/context.js index 436b2c8aa1..58bc94d13e 100644 --- a/src/babel/traversal/context.js +++ b/src/babel/traversal/context.js @@ -7,6 +7,7 @@ export default class TraversalContext { this.scope = scope; this.state = state; this.opts = opts; + this.queue = null; } shouldVisit(node) { diff --git a/src/babel/traversal/path/index.js b/src/babel/traversal/path/index.js index 96b37e1613..be693d8b47 100644 --- a/src/babel/traversal/path/index.js +++ b/src/babel/traversal/path/index.js @@ -10,6 +10,23 @@ export default class NodePath { this.parent = parent; this.data = {}; this.hub = hub; + + this.shouldSkip = false; + this.shouldStop = false; + this.removed = false; + this.state = null; + this.opts = null; + this.skipKeys = null; + this.parentPath = null; + this.context = null; + this.container = null; + this.containerKey = null; + this.key = null; + this.node = null; + this.scope = null; + this.breakOnScopePaths = null; + this.type = null; + this.typeAnnotation = null; } /** diff --git a/src/babel/traversal/scope/binding.js b/src/babel/traversal/scope/binding.js index 77fc9eb156..efc40358d2 100644 --- a/src/babel/traversal/scope/binding.js +++ b/src/babel/traversal/scope/binding.js @@ -11,6 +11,10 @@ export default class Binding { this.path = path; this.kind = kind; + this.hasValue = false; + this.hasDeoptedValue = false; + this.value = null; + this.clearValue(); if (existing) {