@@ -52,7 +52,7 @@ return /******/ (function(modules) { // webpackBootstrap
52
52
/************************************************************************/
53
53
/******/ ( [
54
54
/* 0 */
55
- /***/ function ( module , exports , __webpack_require__ ) {
55
+ /***/ ( function ( module , exports , __webpack_require__ ) {
56
56
57
57
/* global require, module, window */
58
58
var Handler = __webpack_require__ ( 1 )
@@ -122,9 +122,9 @@ return /******/ (function(modules) { // webpackBootstrap
122
122
123
123
module . exports = Mock
124
124
125
- /***/ } ,
125
+ /***/ } ) ,
126
126
/* 1 */
127
- /***/ function ( module , exports , __webpack_require__ ) {
127
+ /***/ ( function ( module , exports , __webpack_require__ ) {
128
128
129
129
/*
130
130
## Handler
@@ -617,29 +617,33 @@ return /******/ (function(modules) { // webpackBootstrap
617
617
}
618
618
}
619
619
620
- key = keyPathParts [ keyPathParts . length - 1 ]
621
- var currentContext = options . context . root
622
- var templateCurrentContext = options . context . templateRoot
623
- for ( var i = 1 ; i < absolutePathParts . length - 1 ; i ++ ) {
624
- currentContext = currentContext [ absolutePathParts [ i ] ]
625
- templateCurrentContext = templateCurrentContext [ absolutePathParts [ i ] ]
626
- }
627
- // 引用的值已经计算好
628
- if ( currentContext && ( key in currentContext ) ) return currentContext [ key ]
620
+ try {
621
+ key = keyPathParts [ keyPathParts . length - 1 ]
622
+ var currentContext = options . context . root
623
+ var templateCurrentContext = options . context . templateRoot
624
+ for ( var i = 1 ; i < absolutePathParts . length - 1 ; i ++ ) {
625
+ currentContext = currentContext [ absolutePathParts [ i ] ]
626
+ templateCurrentContext = templateCurrentContext [ absolutePathParts [ i ] ]
627
+ }
628
+ // 引用的值已经计算好
629
+ if ( currentContext && ( key in currentContext ) ) return currentContext [ key ]
630
+
631
+ // 尚未计算,递归引用数据模板中的属性
632
+ if ( templateCurrentContext &&
633
+ ( typeof templateCurrentContext === 'object' ) &&
634
+ ( key in templateCurrentContext ) &&
635
+ ( originalKey !== templateCurrentContext [ key ] ) // fix #15 避免自己依赖自己
636
+ ) {
637
+ // 先计算被引用的属性值
638
+ templateCurrentContext [ key ] = Handler . gen ( templateCurrentContext [ key ] , key , {
639
+ currentContext : currentContext ,
640
+ templateCurrentContext : templateCurrentContext
641
+ } )
642
+ return templateCurrentContext [ key ]
643
+ }
644
+ } catch ( err ) { }
629
645
630
- // 尚未计算,递归引用数据模板中的属性
631
- if ( templateCurrentContext &&
632
- ( typeof templateCurrentContext === 'object' ) &&
633
- ( key in templateCurrentContext ) &&
634
- ( originalKey !== templateCurrentContext [ key ] ) // fix #15 避免自己依赖自己
635
- ) {
636
- // 先计算被引用的属性值
637
- templateCurrentContext [ key ] = Handler . gen ( templateCurrentContext [ key ] , key , {
638
- currentContext : currentContext ,
639
- templateCurrentContext : templateCurrentContext
640
- } )
641
- return templateCurrentContext [ key ]
642
- }
646
+ return '@' + keyPathParts . join ( '/' )
643
647
} ,
644
648
// https://github.com/kissyteam/kissy/blob/master/src/path/src/path.js
645
649
normalizePath : function ( pathParts ) {
@@ -667,9 +671,9 @@ return /******/ (function(modules) { // webpackBootstrap
667
671
668
672
module . exports = Handler
669
673
670
- /***/ } ,
674
+ /***/ } ) ,
671
675
/* 2 */
672
- /***/ function ( module , exports ) {
676
+ /***/ ( function ( module , exports ) {
673
677
674
678
/*
675
679
## Constant
@@ -705,9 +709,9 @@ return /******/ (function(modules) { // webpackBootstrap
705
709
// RE_KEY: /^key$/
706
710
}
707
711
708
- /***/ } ,
712
+ /***/ } ) ,
709
713
/* 3 */
710
- /***/ function ( module , exports ) {
714
+ /***/ ( function ( module , exports ) {
711
715
712
716
/*
713
717
## Utilities
@@ -836,9 +840,9 @@ return /******/ (function(modules) { // webpackBootstrap
836
840
837
841
module . exports = Util
838
842
839
- /***/ } ,
843
+ /***/ } ) ,
840
844
/* 4 */
841
- /***/ function ( module , exports , __webpack_require__ ) {
845
+ /***/ ( function ( module , exports , __webpack_require__ ) {
842
846
843
847
/*
844
848
## Parser
@@ -912,9 +916,9 @@ return /******/ (function(modules) { // webpackBootstrap
912
916
}
913
917
}
914
918
915
- /***/ } ,
919
+ /***/ } ) ,
916
920
/* 5 */
917
- /***/ function ( module , exports , __webpack_require__ ) {
921
+ /***/ ( function ( module , exports , __webpack_require__ ) {
918
922
919
923
/*
920
924
## Mock.Random
@@ -941,9 +945,9 @@ return /******/ (function(modules) { // webpackBootstrap
941
945
942
946
module . exports = Random
943
947
944
- /***/ } ,
948
+ /***/ } ) ,
945
949
/* 6 */
946
- /***/ function ( module , exports ) {
950
+ /***/ ( function ( module , exports ) {
947
951
948
952
/*
949
953
## Basics
@@ -1072,9 +1076,9 @@ return /******/ (function(modules) { // webpackBootstrap
1072
1076
}
1073
1077
}
1074
1078
1075
- /***/ } ,
1079
+ /***/ } ) ,
1076
1080
/* 7 */
1077
- /***/ function ( module , exports ) {
1081
+ /***/ ( function ( module , exports ) {
1078
1082
1079
1083
/*
1080
1084
## Date
@@ -1218,9 +1222,9 @@ return /******/ (function(modules) { // webpackBootstrap
1218
1222
}
1219
1223
}
1220
1224
1221
- /***/ } ,
1225
+ /***/ } ) ,
1222
1226
/* 8 */
1223
- /***/ function ( module , exports , __webpack_require__ ) {
1227
+ /***/ ( function ( module , exports , __webpack_require__ ) {
1224
1228
1225
1229
/* WEBPACK VAR INJECTION */ ( function ( module ) { /* global document */
1226
1230
/*
@@ -1506,9 +1510,9 @@ return /******/ (function(modules) { // webpackBootstrap
1506
1510
}
1507
1511
/* WEBPACK VAR INJECTION */ } . call ( exports , __webpack_require__ ( 9 ) ( module ) ) )
1508
1512
1509
- /***/ } ,
1513
+ /***/ } ) ,
1510
1514
/* 9 */
1511
- /***/ function ( module , exports ) {
1515
+ /***/ ( function ( module , exports ) {
1512
1516
1513
1517
module . exports = function ( module ) {
1514
1518
if ( ! module . webpackPolyfill ) {
@@ -1522,9 +1526,9 @@ return /******/ (function(modules) { // webpackBootstrap
1522
1526
}
1523
1527
1524
1528
1525
- /***/ } ,
1529
+ /***/ } ) ,
1526
1530
/* 10 */
1527
- /***/ function ( module , exports , __webpack_require__ ) {
1531
+ /***/ ( function ( module , exports , __webpack_require__ ) {
1528
1532
1529
1533
/*
1530
1534
## Color
@@ -1664,9 +1668,9 @@ return /******/ (function(modules) { // webpackBootstrap
1664
1668
}
1665
1669
}
1666
1670
1667
- /***/ } ,
1671
+ /***/ } ) ,
1668
1672
/* 11 */
1669
- /***/ function ( module , exports ) {
1673
+ /***/ ( function ( module , exports ) {
1670
1674
1671
1675
/*
1672
1676
## Color Convert
@@ -1846,9 +1850,9 @@ return /******/ (function(modules) { // webpackBootstrap
1846
1850
}
1847
1851
}
1848
1852
1849
- /***/ } ,
1853
+ /***/ } ) ,
1850
1854
/* 12 */
1851
- /***/ function ( module , exports ) {
1855
+ /***/ ( function ( module , exports ) {
1852
1856
1853
1857
/*
1854
1858
## Color 字典数据
@@ -1927,9 +1931,9 @@ return /******/ (function(modules) { // webpackBootstrap
1927
1931
}
1928
1932
}
1929
1933
1930
- /***/ } ,
1934
+ /***/ } ) ,
1931
1935
/* 13 */
1932
- /***/ function ( module , exports , __webpack_require__ ) {
1936
+ /***/ ( function ( module , exports , __webpack_require__ ) {
1933
1937
1934
1938
/*
1935
1939
## Text
@@ -2053,9 +2057,9 @@ return /******/ (function(modules) { // webpackBootstrap
2053
2057
}
2054
2058
}
2055
2059
2056
- /***/ } ,
2060
+ /***/ } ) ,
2057
2061
/* 14 */
2058
- /***/ function ( module , exports , __webpack_require__ ) {
2062
+ /***/ ( function ( module , exports , __webpack_require__ ) {
2059
2063
2060
2064
/*
2061
2065
## Helpers
@@ -2174,9 +2178,9 @@ return /******/ (function(modules) { // webpackBootstrap
2174
2178
}
2175
2179
}
2176
2180
2177
- /***/ } ,
2181
+ /***/ } ) ,
2178
2182
/* 15 */
2179
- /***/ function ( module , exports ) {
2183
+ /***/ ( function ( module , exports ) {
2180
2184
2181
2185
/*
2182
2186
## Name
@@ -2266,9 +2270,9 @@ return /******/ (function(modules) { // webpackBootstrap
2266
2270
}
2267
2271
}
2268
2272
2269
- /***/ } ,
2273
+ /***/ } ) ,
2270
2274
/* 16 */
2271
- /***/ function ( module , exports ) {
2275
+ /***/ ( function ( module , exports ) {
2272
2276
2273
2277
/*
2274
2278
## Web
@@ -2347,9 +2351,9 @@ return /******/ (function(modules) { // webpackBootstrap
2347
2351
}
2348
2352
}
2349
2353
2350
- /***/ } ,
2354
+ /***/ } ) ,
2351
2355
/* 17 */
2352
- /***/ function ( module , exports , __webpack_require__ ) {
2356
+ /***/ ( function ( module , exports , __webpack_require__ ) {
2353
2357
2354
2358
/*
2355
2359
## Address
@@ -2399,9 +2403,9 @@ return /******/ (function(modules) { // webpackBootstrap
2399
2403
// state: function() {},
2400
2404
}
2401
2405
2402
- /***/ } ,
2406
+ /***/ } ) ,
2403
2407
/* 18 */
2404
- /***/ function ( module , exports ) {
2408
+ /***/ ( function ( module , exports ) {
2405
2409
2406
2410
/*
2407
2411
## Address 字典数据
@@ -6472,9 +6476,9 @@ return /******/ (function(modules) { // webpackBootstrap
6472
6476
6473
6477
module . exports = DICT_FIXED
6474
6478
6475
- /***/ } ,
6479
+ /***/ } ) ,
6476
6480
/* 19 */
6477
- /***/ function ( module , exports , __webpack_require__ ) {
6481
+ /***/ ( function ( module , exports , __webpack_require__ ) {
6478
6482
6479
6483
/*
6480
6484
## Miscellaneous
@@ -6582,9 +6586,9 @@ return /******/ (function(modules) { // webpackBootstrap
6582
6586
}
6583
6587
}
6584
6588
6585
- /***/ } ,
6589
+ /***/ } ) ,
6586
6590
/* 20 */
6587
- /***/ function ( module , exports , __webpack_require__ ) {
6591
+ /***/ ( function ( module , exports , __webpack_require__ ) {
6588
6592
6589
6593
var Parser = __webpack_require__ ( 21 )
6590
6594
var Handler = __webpack_require__ ( 22 )
@@ -6593,9 +6597,9 @@ return /******/ (function(modules) { // webpackBootstrap
6593
6597
Handler : Handler
6594
6598
}
6595
6599
6596
- /***/ } ,
6600
+ /***/ } ) ,
6597
6601
/* 21 */
6598
- /***/ function ( module , exports ) {
6602
+ /***/ ( function ( module , exports ) {
6599
6603
6600
6604
// https://github.com/nuysoft/regexp
6601
6605
// forked from https://github.com/ForbesLindesay/regexp
@@ -7168,9 +7172,9 @@ return /******/ (function(modules) { // webpackBootstrap
7168
7172
7169
7173
module . exports = parser
7170
7174
7171
- /***/ } ,
7175
+ /***/ } ) ,
7172
7176
/* 22 */
7173
- /***/ function ( module , exports , __webpack_require__ ) {
7177
+ /***/ ( function ( module , exports , __webpack_require__ ) {
7174
7178
7175
7179
/*
7176
7180
## RegExp Handler
@@ -7565,15 +7569,15 @@ return /******/ (function(modules) { // webpackBootstrap
7565
7569
7566
7570
module . exports = Handler
7567
7571
7568
- /***/ } ,
7572
+ /***/ } ) ,
7569
7573
/* 23 */
7570
- /***/ function ( module , exports , __webpack_require__ ) {
7574
+ /***/ ( function ( module , exports , __webpack_require__ ) {
7571
7575
7572
7576
module . exports = __webpack_require__ ( 24 )
7573
7577
7574
- /***/ } ,
7578
+ /***/ } ) ,
7575
7579
/* 24 */
7576
- /***/ function ( module , exports , __webpack_require__ ) {
7580
+ /***/ ( function ( module , exports , __webpack_require__ ) {
7577
7581
7578
7582
/*
7579
7583
## toJSONSchema
@@ -7624,15 +7628,15 @@ return /******/ (function(modules) { // webpackBootstrap
7624
7628
module . exports = toJSONSchema
7625
7629
7626
7630
7627
- /***/ } ,
7631
+ /***/ } ) ,
7628
7632
/* 25 */
7629
- /***/ function ( module , exports , __webpack_require__ ) {
7633
+ /***/ ( function ( module , exports , __webpack_require__ ) {
7630
7634
7631
7635
module . exports = __webpack_require__ ( 26 )
7632
7636
7633
- /***/ } ,
7637
+ /***/ } ) ,
7634
7638
/* 26 */
7635
- /***/ function ( module , exports , __webpack_require__ ) {
7639
+ /***/ ( function ( module , exports , __webpack_require__ ) {
7636
7640
7637
7641
/*
7638
7642
## valid(template, data)
@@ -8080,15 +8084,15 @@ return /******/ (function(modules) { // webpackBootstrap
8080
8084
8081
8085
module . exports = valid
8082
8086
8083
- /***/ } ,
8087
+ /***/ } ) ,
8084
8088
/* 27 */
8085
- /***/ function ( module , exports , __webpack_require__ ) {
8089
+ /***/ ( function ( module , exports , __webpack_require__ ) {
8086
8090
8087
8091
module . exports = __webpack_require__ ( 28 )
8088
8092
8089
- /***/ } ,
8093
+ /***/ } ) ,
8090
8094
/* 28 */
8091
- /***/ function ( module , exports , __webpack_require__ ) {
8095
+ /***/ ( function ( module , exports , __webpack_require__ ) {
8092
8096
8093
8097
/* global window, document, location, Event, setTimeout */
8094
8098
/*
@@ -8533,7 +8537,7 @@ return /******/ (function(modules) { // webpackBootstrap
8533
8537
8534
8538
module . exports = MockXMLHttpRequest
8535
8539
8536
- /***/ }
8540
+ /***/ } )
8537
8541
/******/ ] )
8538
8542
} ) ;
8539
8543
;
0 commit comments