@@ -13,7 +13,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
var Vue__default = /*#__PURE__*/ _interopDefaultLegacy ( Vue ) ;
14
14
var cheerio__default = /*#__PURE__*/ _interopDefaultLegacy ( cheerio ) ;
15
15
16
- //
16
+ //
17
17
18
18
function createVNodes ( vm , slotValue , name ) {
19
19
var el = vueTemplateCompiler . compileToFunctions (
@@ -1698,7 +1698,7 @@ var CREATE_ELEMENT_ALIAS = semver.gt(Vue__default['default'].version, '2.1.5')
1698
1698
? '_c'
1699
1699
: '_h' ;
1700
1700
1701
- //
1701
+ //
1702
1702
1703
1703
function findDOMNodes (
1704
1704
element ,
@@ -1716,7 +1716,7 @@ function findDOMNodes(
1716
1716
return nodes . concat ( [ ] . slice . call ( element . querySelectorAll ( selector ) ) )
1717
1717
}
1718
1718
1719
- //
1719
+ //
1720
1720
1721
1721
function isDomSelector ( selector ) {
1722
1722
if ( typeof selector !== 'string' ) {
@@ -1750,7 +1750,7 @@ function isVueComponent(c) {
1750
1750
return true
1751
1751
}
1752
1752
1753
- if ( ! isPlainObject ( c ) ) {
1753
+ if ( c === null || typeof c !== 'object' ) {
1754
1754
return false
1755
1755
}
1756
1756
@@ -1780,7 +1780,7 @@ function componentNeedsCompiling(component) {
1780
1780
1781
1781
function isRefSelector ( refOptionsObject ) {
1782
1782
if (
1783
- ! isPlainObject ( refOptionsObject ) ||
1783
+ typeof refOptionsObject !== 'object' ||
1784
1784
Object . keys ( refOptionsObject || { } ) . length !== 1
1785
1785
) {
1786
1786
return false
@@ -1790,7 +1790,7 @@ function isRefSelector(refOptionsObject) {
1790
1790
}
1791
1791
1792
1792
function isNameSelector ( nameOptionsObject ) {
1793
- if ( ! isPlainObject ( nameOptionsObject ) ) {
1793
+ if ( typeof nameOptionsObject !== 'object' || nameOptionsObject === null ) {
1794
1794
return false
1795
1795
}
1796
1796
@@ -1806,7 +1806,7 @@ function isDynamicComponent(c) {
1806
1806
}
1807
1807
1808
1808
function isComponentOptions ( c ) {
1809
- return isPlainObject ( c ) && ( c . template || c . render )
1809
+ return c !== null && typeof c === 'object' && ( c . template || c . render )
1810
1810
}
1811
1811
1812
1812
function isFunctionalComponent ( c ) {
@@ -1848,10 +1848,10 @@ function makeMap(str, expectsLowerCase) {
1848
1848
map [ list [ i ] ] = true ;
1849
1849
}
1850
1850
return expectsLowerCase
1851
- ? function ( val ) {
1851
+ ? function ( val ) {
1852
1852
return map [ val . toLowerCase ( ) ]
1853
1853
}
1854
- : function ( val ) {
1854
+ : function ( val ) {
1855
1855
return map [ val ]
1856
1856
}
1857
1857
}
@@ -1961,7 +1961,7 @@ function matches(node, selector) {
1961
1961
return vmMatchesName ( componentInstance , nameSelector )
1962
1962
}
1963
1963
1964
- //
1964
+ //
1965
1965
1966
1966
function findAllInstances ( rootVm ) {
1967
1967
var instances = [ rootVm ] ;
@@ -2099,7 +2099,7 @@ function normalizeProvide(provide) {
2099
2099
return provide
2100
2100
}
2101
2101
2102
- //
2102
+ //
2103
2103
2104
2104
function getOption ( option , config ) {
2105
2105
if ( option === false ) {
@@ -7545,7 +7545,7 @@ function ocd(str, options) {
7545
7545
. replace ( / > ( \s * ) (? = < ! - - \s * \/ ) / g, '> ' ) ;
7546
7546
}
7547
7547
7548
- //
7548
+ //
7549
7549
7550
7550
function getSelectorType ( selector ) {
7551
7551
if ( isDomSelector ( selector ) ) { return DOM_SELECTOR }
@@ -7573,7 +7573,7 @@ function getSelector(
7573
7573
}
7574
7574
}
7575
7575
7576
- //
7576
+ //
7577
7577
7578
7578
var WrapperArray = function WrapperArray ( wrappers ) {
7579
7579
var length = wrappers . length ;
@@ -7799,7 +7799,7 @@ WrapperArray.prototype.destroy = function destroy () {
7799
7799
this . wrappers . forEach ( function ( wrapper ) { return wrapper . destroy ( ) ; } ) ;
7800
7800
} ;
7801
7801
7802
- //
7802
+ //
7803
7803
7804
7804
var buildSelectorString = function ( selector ) {
7805
7805
if ( getSelectorType ( selector ) === REF_SELECTOR ) {
@@ -8084,10 +8084,7 @@ ErrorWrapper.prototype.destroy = function destroy () {
8084
8084
*/
8085
8085
8086
8086
function isStyleVisible ( element ) {
8087
- if (
8088
- ! ( element instanceof window . HTMLElement ) &&
8089
- ! ( element instanceof window . SVGElement )
8090
- ) {
8087
+ if ( ! ( element instanceof HTMLElement ) && ! ( element instanceof SVGElement ) ) {
8091
8088
return false
8092
8089
}
8093
8090
@@ -9487,7 +9484,7 @@ function createDOMEvent(type, options) {
9487
9484
return event
9488
9485
}
9489
9486
9490
- //
9487
+ //
9491
9488
9492
9489
var Wrapper = function Wrapper (
9493
9490
node ,
@@ -9964,7 +9961,9 @@ Wrapper.prototype.overview = function overview () {
9964
9961
var emittedJSONReplacer = function ( key , value ) { return value instanceof Array
9965
9962
? value . map ( function ( calledWith , index ) {
9966
9963
var callParams = calledWith . map ( function ( param ) { return typeof param === 'object'
9967
- ? JSON . stringify ( param ) . replace ( / " / g, '' ) . replace ( / , / g, ', ' )
9964
+ ? JSON . stringify ( param )
9965
+ . replace ( / " / g, '' )
9966
+ . replace ( / , / g, ', ' )
9968
9967
: param ; }
9969
9968
) ;
9970
9969
@@ -10188,7 +10187,8 @@ Wrapper.prototype.setProps = function setProps (data) {
10188
10187
Object . keys ( data ) . forEach ( function ( key ) {
10189
10188
// Don't let people set entire objects, because reactivity won't work
10190
10189
if (
10191
- isPlainObject ( data [ key ] ) &&
10190
+ typeof data [ key ] === 'object' &&
10191
+ data [ key ] !== null &&
10192
10192
// $FlowIgnore : Problem with possibly null this.vm
10193
10193
data [ key ] === this$1 . vm [ key ]
10194
10194
) {
@@ -10359,7 +10359,7 @@ Wrapper.prototype.trigger = function trigger (type, options) {
10359
10359
return nextTick ( )
10360
10360
} ;
10361
10361
10362
- //
10362
+ //
10363
10363
10364
10364
var VueWrapper = /*@__PURE__ */ ( function ( Wrapper ) {
10365
10365
function VueWrapper ( vm , options ) {
@@ -10398,7 +10398,7 @@ var VueWrapper = /*@__PURE__*/(function (Wrapper) {
10398
10398
return VueWrapper ;
10399
10399
} ( Wrapper ) ) ;
10400
10400
10401
- //
10401
+ //
10402
10402
10403
10403
function createWrapper (
10404
10404
node ,
@@ -12900,7 +12900,7 @@ function cloneDeep(value) {
12900
12900
12901
12901
var cloneDeep_1 = cloneDeep ;
12902
12902
12903
- //
12903
+ //
12904
12904
12905
12905
/**
12906
12906
* Used internally by vue-server-test-utils and test-utils to propagate/create vue instances.
@@ -12969,7 +12969,7 @@ function _createLocalVue(
12969
12969
return instance
12970
12970
}
12971
12971
12972
- //
12972
+ //
12973
12973
12974
12974
function compileTemplate ( component ) {
12975
12975
if ( component . template ) {
@@ -13024,7 +13024,7 @@ function compileTemplateForSlots(slots) {
13024
13024
} ) ;
13025
13025
}
13026
13026
13027
- //
13027
+ //
13028
13028
13029
13029
function isValidSlot ( slot ) {
13030
13030
return isVueComponent ( slot ) || typeof slot === 'string'
@@ -13121,7 +13121,7 @@ function validateOptions(options, component) {
13121
13121
Vue__default [ 'default' ] . config . productionTip = false ;
13122
13122
Vue__default [ 'default' ] . config . devtools = false ;
13123
13123
13124
- //
13124
+ //
13125
13125
13126
13126
function throwError ( msg ) {
13127
13127
throw new Error ( ( "[vue-test-utils]: " + msg ) )
@@ -13234,7 +13234,7 @@ function isVueWrapper(wrapper) {
13234
13234
return wrapper . vm || wrapper . isFunctionalComponent
13235
13235
}
13236
13236
13237
- //
13237
+ //
13238
13238
13239
13239
function addMocks (
13240
13240
_Vue ,
@@ -13261,7 +13261,7 @@ function addMocks(
13261
13261
} ) ;
13262
13262
}
13263
13263
13264
- //
13264
+ //
13265
13265
13266
13266
function logEvents (
13267
13267
vm ,
@@ -13280,7 +13280,7 @@ function logEvents(
13280
13280
13281
13281
function addEventLogger ( _Vue ) {
13282
13282
_Vue . mixin ( {
13283
- beforeCreate : function ( ) {
13283
+ beforeCreate : function ( ) {
13284
13284
this . __emitted = Object . create ( null ) ;
13285
13285
this . __emittedByOrder = [ ] ;
13286
13286
logEvents ( this , this . __emitted , this . __emittedByOrder ) ;
@@ -13298,7 +13298,7 @@ function addStubs(_Vue, stubComponents) {
13298
13298
_Vue . mixin ( ( obj = { } , obj [ BEFORE_RENDER_LIFECYCLE_HOOK ] = addStubComponentsMixin , obj ) ) ;
13299
13299
}
13300
13300
13301
- //
13301
+ //
13302
13302
13303
13303
var MOUNTING_OPTIONS = [
13304
13304
'attachToDocument' ,
@@ -13322,13 +13322,15 @@ function extractInstanceOptions(options) {
13322
13322
return instanceOptions
13323
13323
}
13324
13324
13325
- //
13325
+ //
13326
13326
13327
13327
function isDestructuringSlotScope ( slotScope ) {
13328
13328
return / ^ { .* } $ / . test ( slotScope )
13329
13329
}
13330
13330
13331
- function getVueTemplateCompilerHelpers ( _Vue ) {
13331
+ function getVueTemplateCompilerHelpers (
13332
+ _Vue
13333
+ ) {
13332
13334
// $FlowIgnore
13333
13335
var vue = new _Vue ( ) ;
13334
13336
var helpers = { } ;
@@ -13427,7 +13429,7 @@ function createScopedSlots(
13427
13429
13428
13430
var slotScope = scopedSlotMatches . match && scopedSlotMatches . match [ 1 ] ;
13429
13431
13430
- scopedSlots [ scopedSlotName ] = function ( props ) {
13432
+ scopedSlots [ scopedSlotName ] = function ( props ) {
13431
13433
var obj ;
13432
13434
13433
13435
var res ;
@@ -13449,7 +13451,7 @@ function createScopedSlots(
13449
13451
return scopedSlots
13450
13452
}
13451
13453
13452
- //
13454
+ //
13453
13455
13454
13456
var FUNCTION_PLACEHOLDER = '[Function]' ;
13455
13457
@@ -13476,10 +13478,10 @@ function resolveComponent$1(obj, component) {
13476
13478
)
13477
13479
}
13478
13480
13479
- function getCoreProperties ( componentOptions , name ) {
13481
+ function getCoreProperties ( componentOptions ) {
13480
13482
return {
13481
13483
attrs : componentOptions . attrs ,
13482
- name : componentOptions . name || name ,
13484
+ name : componentOptions . name ,
13483
13485
model : componentOptions . model ,
13484
13486
props : componentOptions . props ,
13485
13487
on : componentOptions . on ,
@@ -13540,7 +13542,7 @@ function createStubFromComponent(
13540
13542
Vue__default [ 'default' ] . config . ignoredElements . push ( tagName ) ;
13541
13543
}
13542
13544
13543
- return Object . assign ( { } , getCoreProperties ( componentOptions , name ) ,
13545
+ return Object . assign ( { } , getCoreProperties ( componentOptions ) ,
13544
13546
{ $_vueTestUtils_original : originalComponent ,
13545
13547
$_doNotStubChildren : true ,
13546
13548
render : function render ( h , context ) {
@@ -13721,16 +13723,8 @@ function patchCreateElement(_Vue, stubs, stubAllComponents) {
13721
13723
}
13722
13724
13723
13725
if ( isConstructor ( el ) || isComponentOptions ( el ) ) {
13724
- var componentOptions = isConstructor ( el ) ? el . options : el ;
13725
- var elName = componentOptions . name ;
13726
-
13727
- var stubbedComponent = resolveComponent ( elName , stubs ) ;
13728
- if ( stubbedComponent ) {
13729
- return originalCreateElement . apply ( void 0 , [ stubbedComponent ] . concat ( args ) )
13730
- }
13731
-
13732
13726
if ( stubAllComponents ) {
13733
- var stub = createStubFromComponent ( el , elName || 'anonymous' , _Vue ) ;
13727
+ var stub = createStubFromComponent ( el , el . name || 'anonymous' , _Vue ) ;
13734
13728
return originalCreateElement . apply ( void 0 , [ stub ] . concat ( args ) )
13735
13729
}
13736
13730
var Constructor = shouldExtend ( el ) ? extend ( el , _Vue ) : el ;
@@ -13767,7 +13761,7 @@ function patchCreateElement(_Vue, stubs, stubAllComponents) {
13767
13761
_Vue . mixin ( ( obj = { } , obj [ BEFORE_RENDER_LIFECYCLE_HOOK ] = patchCreateElementMixin , obj ) ) ;
13768
13762
}
13769
13763
13770
- //
13764
+ //
13771
13765
13772
13766
function objectWithoutProperties ( obj , exclude ) { var target = { } ; for ( var k in obj ) if ( Object . prototype . hasOwnProperty . call ( obj , k ) && exclude . indexOf ( k ) === - 1 ) target [ k ] = obj [ k ] ; return target ; }
13773
13767
@@ -13864,22 +13858,22 @@ function createInstance(
13864
13858
var parentComponentOptions = options . parentComponent || { } ;
13865
13859
13866
13860
var originalParentComponentProvide = parentComponentOptions . provide ;
13867
- parentComponentOptions . provide = function ( ) {
13861
+ parentComponentOptions . provide = function ( ) {
13868
13862
return Object . assign ( { } , getValuesFromCallableOption . call ( this , originalParentComponentProvide ) ,
13869
13863
// $FlowIgnore
13870
13864
getValuesFromCallableOption . call ( this , options . provide ) )
13871
13865
} ;
13872
13866
13873
13867
var originalParentComponentData = parentComponentOptions . data ;
13874
- parentComponentOptions . data = function ( ) {
13868
+ parentComponentOptions . data = function ( ) {
13875
13869
return Object . assign ( { } , getValuesFromCallableOption . call ( this , originalParentComponentData ) ,
13876
13870
{ vueTestUtils_childProps : Object . assign ( { } , options . propsData ) } )
13877
13871
} ;
13878
13872
13879
13873
parentComponentOptions . $_doNotStubChildren = true ;
13880
13874
parentComponentOptions . $_isWrapperParent = true ;
13881
13875
parentComponentOptions . _isFunctionalContainer = componentOptions . functional ;
13882
- parentComponentOptions . render = function ( h ) {
13876
+ parentComponentOptions . render = function ( h ) {
13883
13877
return h (
13884
13878
Constructor ,
13885
13879
createContext ( options , scopedSlots , this . vueTestUtils_childProps ) ,
@@ -13901,7 +13895,7 @@ function createInstance(
13901
13895
13902
13896
var config$1 = testUtils . config ;
13903
13897
13904
- //
13898
+ //
13905
13899
13906
13900
Vue__default [ 'default' ] . config . productionTip = false ;
13907
13901
Vue__default [ 'default' ] . config . devtools = false ;
@@ -13936,7 +13930,7 @@ function renderToString(
13936
13930
return renderer . renderToString ( vm )
13937
13931
}
13938
13932
13939
- //
13933
+ //
13940
13934
13941
13935
function render (
13942
13936
component ,
0 commit comments