2
2
'use strict'
3
3
4
4
import asyncIterators from './async_iterators.js'
5
- import { Sync , isSync , Unfound } from './constants.js'
5
+ import { Sync , isSync , Unfound , OriginalImpl } from './constants.js'
6
6
import declareSync from './utilities/declareSync.js'
7
7
import { build , buildString } from './compiler.js'
8
8
import chainingSupported from './utilities/chainingSupported.js'
@@ -277,7 +277,7 @@ const defaultMethods = {
277
277
} ,
278
278
deterministic : ( data , buildState ) => isDeterministic ( data , buildState . engine , buildState ) ,
279
279
compile : ( data , buildState ) => {
280
- if ( ! buildState . engine . truthy . IDENTITY ) return false
280
+ if ( ! buildState . engine . truthy [ OriginalImpl ] ) return false
281
281
if ( Array . isArray ( data ) && data . length ) return `(${ data . map ( ( i ) => buildString ( i , buildState ) ) . join ( ' || ' ) } )`
282
282
return `(${ buildString ( data , buildState ) } ).reduce((a,b) => a||b, false)`
283
283
} ,
@@ -311,7 +311,7 @@ const defaultMethods = {
311
311
traverse : false ,
312
312
deterministic : ( data , buildState ) => isDeterministic ( data , buildState . engine , buildState ) ,
313
313
compile : ( data , buildState ) => {
314
- if ( ! buildState . engine . truthy . IDENTITY ) return false
314
+ if ( ! buildState . engine . truthy [ OriginalImpl ] ) return false
315
315
if ( Array . isArray ( data ) && data . length ) return `(${ data . map ( ( i ) => buildString ( i , buildState ) ) . join ( ' && ' ) } )`
316
316
return `(${ buildString ( data , buildState ) } ).reduce((a,b) => a&&b, true)`
317
317
}
@@ -337,6 +337,7 @@ const defaultMethods = {
337
337
deterministic : false
338
338
} ,
339
339
val : {
340
+ [ OriginalImpl ] : true ,
340
341
method : ( args , context , above , engine , /** @type {null | Symbol } */ unFound = null ) => {
341
342
if ( Array . isArray ( args ) && args . length === 1 ) args = args [ 0 ]
342
343
// A unary optimization
0 commit comments