1- /* eslint-disable no-ex-assign */
2- /* eslint-disable no-throw-literal */
31// @ts -check
42'use strict'
53
@@ -118,6 +116,7 @@ const defaultMethods = {
118116 throw : ( type ) => {
119117 if ( Array . isArray ( type ) ) type = type [ 0 ]
120118 if ( typeof type === 'object' ) throw type
119+ // eslint-disable-next-line no-throw-literal
121120 throw { type }
122121 } ,
123122 max : ( data ) => Math . max ( ...data ) ,
@@ -388,6 +387,7 @@ const defaultMethods = {
388387 try {
389388 res = buildState . compile `((context, above) => { try { return ${ data [ 0 ] } } catch(err) { above = [null, context, above]; context = { type: err.type || err.message || err.toString() }; `
390389 } catch ( err ) {
390+ // eslint-disable-next-line no-ex-assign
391391 if ( Number . isNaN ( err ) ) err = { type : 'NaN' }
392392 res = { [ Compiled ] : `((context, above) => { { above = [null, context, above]; context = ${ JSON . stringify ( err ) } ; ` }
393393 }
@@ -398,6 +398,7 @@ const defaultMethods = {
398398 if ( i === data . length - 1 ) res = buildState . compile `${ res } try { return ${ data [ i ] } } catch(err) { throw err; } `
399399 else res = buildState . compile `${ res } try { return ${ data [ i ] } } catch(err) { context = { type: err.type || err.message || err.toString() }; } `
400400 } catch ( err ) {
401+ // eslint-disable-next-line no-ex-assign
401402 if ( Number . isNaN ( err ) ) err = { type : 'NaN' }
402403 if ( i === data . length - 1 ) res = buildState . compile `${ res } throw ${ { [ Compiled ] : JSON . stringify ( err ) } } `
403404 else res = buildState . compile `${ res } ${ { [ Compiled ] : `context = ${ JSON . stringify ( err ) } ;` } } `
0 commit comments