From 5cfdf1a2484fa73b572eae4afd196dcf9e1912ba Mon Sep 17 00:00:00 2001 From: Alex Ivasyuv Date: Wed, 24 Oct 2018 20:06:17 +0300 Subject: [PATCH] fix: handle undefined style properties in jsdom (fix #7444) (#8281) --- src/platforms/web/runtime/transition-util.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/platforms/web/runtime/transition-util.js b/src/platforms/web/runtime/transition-util.js index 47668f0c..70621014 100644 --- a/src/platforms/web/runtime/transition-util.js +++ b/src/platforms/web/runtime/transition-util.js @@ -122,11 +122,12 @@ export function getTransitionInfo (el: Element, expectedType?: ?string): { hasTransform: boolean; } { const styles: any = window.getComputedStyle(el) - const transitionDelays: Array = styles[transitionProp + 'Delay'].split(', ') - const transitionDurations: Array = styles[transitionProp + 'Duration'].split(', ') + // JSDOM may return undefined for transition properties + const transitionDelays: Array = (styles[transitionProp + 'Delay'] || '').split(', ') + const transitionDurations: Array = (styles[transitionProp + 'Duration'] || '').split(', ') const transitionTimeout: number = getTimeout(transitionDelays, transitionDurations) - const animationDelays: Array = styles[animationProp + 'Delay'].split(', ') - const animationDurations: Array = styles[animationProp + 'Duration'].split(', ') + const animationDelays: Array = (styles[animationProp + 'Delay'] || '').split(', ') + const animationDurations: Array = (styles[animationProp + 'Duration'] || '').split(', ') const animationTimeout: number = getTimeout(animationDelays, animationDurations) let type: ?string