22'use strict'
33
44import asyncIterators from './async_iterators.js'
5- import { Sync , isSync , Unfound } from './constants.js'
5+ import { Sync , isSync , Unfound , OriginalImpl } from './constants.js'
66import declareSync from './utilities/declareSync.js'
77import { build , buildString } from './compiler.js'
88import chainingSupported from './utilities/chainingSupported.js'
@@ -277,7 +277,7 @@ const defaultMethods = {
277277 } ,
278278 deterministic : ( data , buildState ) => isDeterministic ( data , buildState . engine , buildState ) ,
279279 compile : ( data , buildState ) => {
280- if ( ! buildState . engine . truthy . IDENTITY ) return false
280+ if ( ! buildState . engine . truthy [ OriginalImpl ] ) return false
281281 if ( Array . isArray ( data ) && data . length ) return `(${ data . map ( ( i ) => buildString ( i , buildState ) ) . join ( ' || ' ) } )`
282282 return `(${ buildString ( data , buildState ) } ).reduce((a,b) => a||b, false)`
283283 } ,
@@ -311,7 +311,7 @@ const defaultMethods = {
311311 traverse : false ,
312312 deterministic : ( data , buildState ) => isDeterministic ( data , buildState . engine , buildState ) ,
313313 compile : ( data , buildState ) => {
314- if ( ! buildState . engine . truthy . IDENTITY ) return false
314+ if ( ! buildState . engine . truthy [ OriginalImpl ] ) return false
315315 if ( Array . isArray ( data ) && data . length ) return `(${ data . map ( ( i ) => buildString ( i , buildState ) ) . join ( ' && ' ) } )`
316316 return `(${ buildString ( data , buildState ) } ).reduce((a,b) => a&&b, true)`
317317 }
@@ -337,6 +337,7 @@ const defaultMethods = {
337337 deterministic : false
338338 } ,
339339 val : {
340+ [ OriginalImpl ] : true ,
340341 method : ( args , context , above , engine , /** @type {null | Symbol } */ unFound = null ) => {
341342 if ( Array . isArray ( args ) && args . length === 1 ) args = args [ 0 ]
342343 // A unary optimization
0 commit comments