@@ -16,7 +16,15 @@ __webpack_require__.r(__webpack_exports__);
16
16
17
17
var pug = __webpack_require__ ( 79 ) ;
18
18
19
- function template ( locals ) { var pug_html = "" , pug_mixins = { } , pug_interp ; ; var locals_for_with = ( locals || { } ) ; ( function ( time ) { pug_html = pug_html + "\u003C!-- this partial is used for frontend and backend--\u003E\u003Cdiv class=\"time\"\u003E \u003Cb\u003ECurrent time\u003C\u002Fb\u003E\u003Cp\u003E" + ( pug . escape ( null == ( pug_interp = time . toISOString ( ) ) ? "" : pug_interp ) ) + "\u003C\u002Fp\u003E\u003C\u002Fdiv\u003E\u003Cimg src=\"#{require('.\u002Flogo.png')}\"\u003E" ; } . call ( this , "time" in locals_for_with ?locals_for_with . time :typeof time !== "undefined" ?time :undefined ) ) ; ; return pug_html ; } ;
19
+ function template ( locals ) { var pug_html = "" , pug_mixins = { } , pug_interp ; ;
20
+ var locals_for_with = ( locals || { } ) ;
21
+
22
+ ( function ( time ) {
23
+ pug_html = pug_html + "\u003C!-- this partial is used for frontend and backend--\u003E\u003Cdiv class=\"time\"\u003E \u003Cb\u003ECurrent time\u003C\u002Fb\u003E\u003Cp\u003E" + ( pug . escape ( null == ( pug_interp = time . toISOString ( ) ) ? "" : pug_interp ) ) + "\u003C\u002Fp\u003E\u003C\u002Fdiv\u003E\u003Cimg src=\"#{require('.\u002Flogo.png')}\"\u003E" ;
24
+ } . call ( this , "time" in locals_for_with ?
25
+ locals_for_with . time :
26
+ typeof time !== 'undefined' ? time : undefined ) ) ;
27
+ ; ; return pug_html ; } ;
20
28
module . exports = template ;
21
29
22
30
/***/ } ) ,
@@ -67,7 +75,7 @@ function pug_merge(a, b) {
67
75
}
68
76
69
77
return a ;
70
- } ;
78
+ }
71
79
72
80
/**
73
81
* Process array, object, or string as a string of classes delimited by a space.
@@ -88,7 +96,10 @@ function pug_merge(a, b) {
88
96
*/
89
97
exports . classes = pug_classes ;
90
98
function pug_classes_array ( val , escaping ) {
91
- var classString = '' , className , padding = '' , escapeEnabled = Array . isArray ( escaping ) ;
99
+ var classString = '' ,
100
+ className ,
101
+ padding = '' ,
102
+ escapeEnabled = Array . isArray ( escaping ) ;
92
103
for ( var i = 0 ; i < val . length ; i ++ ) {
93
104
className = pug_classes ( val [ i ] ) ;
94
105
if ( ! className ) continue ;
@@ -99,7 +110,8 @@ function pug_classes_array(val, escaping) {
99
110
return classString ;
100
111
}
101
112
function pug_classes_object ( val ) {
102
- var classString = '' , padding = '' ;
113
+ var classString = '' ,
114
+ padding = '' ;
103
115
for ( var key in val ) {
104
116
if ( key && val [ key ] && pug_has_own_property . call ( val , key ) ) {
105
117
classString = classString + padding + key ;
@@ -140,7 +152,7 @@ function pug_style(val) {
140
152
} else {
141
153
return val + '' ;
142
154
}
143
- } ;
155
+ }
144
156
145
157
/**
146
158
* Render the given attribute.
@@ -153,25 +165,32 @@ function pug_style(val) {
153
165
*/
154
166
exports . attr = pug_attr ;
155
167
function pug_attr ( key , val , escaped , terse ) {
156
- if ( val === false || val == null || ! val && ( key === 'class' || key === 'style' ) ) {
168
+ if (
169
+ val === false ||
170
+ val == null ||
171
+ ( ! val && ( key === 'class' || key === 'style' ) )
172
+ ) {
157
173
return '' ;
158
174
}
159
175
if ( val === true ) {
160
176
return ' ' + ( terse ? key : key + '="' + key + '"' ) ;
161
177
}
162
178
var type = typeof val ;
163
- if ( ( type === 'object' || type === 'function' ) && typeof val . toJSON === 'function' ) {
179
+ if (
180
+ ( type === 'object' || type === 'function' ) &&
181
+ typeof val . toJSON === 'function'
182
+ ) {
164
183
val = val . toJSON ( ) ;
165
184
}
166
185
if ( typeof val !== 'string' ) {
167
186
val = JSON . stringify ( val ) ;
168
187
if ( ! escaped && val . indexOf ( '"' ) !== - 1 ) {
169
- return ' ' + key + '=\'' + val . replace ( / ' / g, ''' ) + '\'' ;
188
+ return ' ' + key + "='" + val . replace ( / ' / g, ''' ) + "'" ;
170
189
}
171
190
}
172
191
if ( escaped ) val = pug_escape ( val ) ;
173
192
return ' ' + key + '="' + val + '"' ;
174
- } ;
193
+ }
175
194
176
195
/**
177
196
* Render the given attributes object.
@@ -181,7 +200,7 @@ function pug_attr(key, val, escaped, terse) {
181
200
* @return {String }
182
201
*/
183
202
exports . attrs = pug_attrs ;
184
- function pug_attrs ( obj , terse ) {
203
+ function pug_attrs ( obj , terse ) {
185
204
var attrs = '' ;
186
205
187
206
for ( var key in obj ) {
@@ -201,7 +220,7 @@ function pug_attrs(obj, terse){
201
220
}
202
221
203
222
return attrs ;
204
- } ;
223
+ }
205
224
206
225
/**
207
226
* Escape the given string of `html`.
@@ -213,7 +232,7 @@ function pug_attrs(obj, terse){
213
232
214
233
var pug_match_html = / [ " & < > ] / ;
215
234
exports . escape = pug_escape ;
216
- function pug_escape ( _html ) {
235
+ function pug_escape ( _html ) {
217
236
var html = '' + _html ;
218
237
var regexResult = pug_match_html . exec ( html ) ;
219
238
if ( ! regexResult ) return _html ;
@@ -222,19 +241,28 @@ function pug_escape(_html){
222
241
var i , lastIndex , escape ;
223
242
for ( i = regexResult . index , lastIndex = 0 ; i < html . length ; i ++ ) {
224
243
switch ( html . charCodeAt ( i ) ) {
225
- case 34 : escape = '"' ; break ;
226
- case 38 : escape = '&' ; break ;
227
- case 60 : escape = '<' ; break ;
228
- case 62 : escape = '>' ; break ;
229
- default : continue ;
244
+ case 34 :
245
+ escape = '"' ;
246
+ break ;
247
+ case 38 :
248
+ escape = '&' ;
249
+ break ;
250
+ case 60 :
251
+ escape = '<' ;
252
+ break ;
253
+ case 62 :
254
+ escape = '>' ;
255
+ break ;
256
+ default :
257
+ continue ;
230
258
}
231
259
if ( lastIndex !== i ) result += html . substring ( lastIndex , i ) ;
232
260
lastIndex = i + 1 ;
233
261
result += escape ;
234
262
}
235
263
if ( lastIndex !== i ) return result + html . substring ( lastIndex , i ) ;
236
264
else return result ;
237
- } ;
265
+ }
238
266
239
267
/**
240
268
* Re-throw the given `err` in context to the
@@ -248,37 +276,49 @@ function pug_escape(_html){
248
276
*/
249
277
250
278
exports . rethrow = pug_rethrow ;
251
- function pug_rethrow ( err , filename , lineno , str ) {
279
+ function pug_rethrow ( err , filename , lineno , str ) {
252
280
if ( ! ( err instanceof Error ) ) throw err ;
253
281
if ( ( typeof window != 'undefined' || ! filename ) && ! str ) {
254
282
err . message += ' on line ' + lineno ;
255
283
throw err ;
256
284
}
285
+ var context , lines , start , end ;
257
286
try {
258
- str = str || __webpack_require__ ( 993 ) . readFileSync ( filename , 'utf8' )
287
+ str = str || __webpack_require__ ( 993 ) . readFileSync ( filename , { encoding : 'utf8' } ) ;
288
+ context = 3 ;
289
+ lines = str . split ( '\n' ) ;
290
+ start = Math . max ( lineno - context , 0 ) ;
291
+ end = Math . min ( lines . length , lineno + context ) ;
259
292
} catch ( ex ) {
260
- pug_rethrow ( err , null , lineno )
293
+ err . message +=
294
+ ' - could not read from ' + filename + ' (' + ex . message + ')' ;
295
+ pug_rethrow ( err , null , lineno ) ;
296
+ return ;
261
297
}
262
- var context = 3
263
- , lines = str . split ( '\n' )
264
- , start = Math . max ( lineno - context , 0 )
265
- , end = Math . min ( lines . length , lineno + context ) ;
266
298
267
299
// Error context
268
- var context = lines . slice ( start , end ) . map ( function ( line , i ) {
269
- var curr = i + start + 1 ;
270
- return ( curr == lineno ? ' > ' : ' ' )
271
- + curr
272
- + '| '
273
- + line ;
274
- } ) . join ( '\n' ) ;
300
+ context = lines
301
+ . slice ( start , end )
302
+ . map ( function ( line , i ) {
303
+ var curr = i + start + 1 ;
304
+ return ( curr == lineno ? ' > ' : ' ' ) + curr + '| ' + line ;
305
+ } )
306
+ . join ( '\n' ) ;
275
307
276
308
// Alter exception message
277
309
err . path = filename ;
278
- err . message = ( filename || 'Pug' ) + ':' + lineno
279
- + '\n' + context + '\n\n' + err . message ;
310
+ try {
311
+ err . message =
312
+ ( filename || 'Pug' ) +
313
+ ':' +
314
+ lineno +
315
+ '\n' +
316
+ context +
317
+ '\n\n' +
318
+ err . message ;
319
+ } catch ( e ) { }
280
320
throw err ;
281
- } ;
321
+ }
282
322
283
323
284
324
/***/ } ) ,
0 commit comments