yasl icon indicating copy to clipboard operation
yasl copied to clipboard

Calling `require` too late in file causes crash.

Open CoffeeTableEspresso opened this issue 2 years ago • 1 comments

The following example will crash:

const x = [ 'a']
const y = []

echo x

y->sort(fn(a, b) {

    return a->tostr('x') < b->tostr('x')
})

y->sort(fn(a, b) {
    y->push(a)
    return a < b
})

echo y

const re = require('tuple')

CoffeeTableEspresso avatar May 17 '23 04:05 CoffeeTableEspresso

This is not surprising given how badly require is written.

CoffeeTableEspresso avatar May 17 '23 04:05 CoffeeTableEspresso

Could not repro, I assume this was a problem with how the tuple module was compiled when I checked this. Have not been able to repro with the given example or any similar ones.

CoffeeTableEspresso avatar Jan 07 '25 01:01 CoffeeTableEspresso