Bruce Pascoe

Results 421 comments of Bruce Pascoe

...I'm just going to ignore this, pretend it doesn't exist and hopefully it'll go away... ;) Operator overloading in JS, eugh. Just the thought makes me cringe.

@svaarala I wonder how difficult it would be to implement classes with the current parser. My initial thought is that it shouldn't be too different from parsing an object literal...

My instinct is that it's probably not worth it to provide a method for manual seeding as such to the application; by the time an application needs to do this...

I actually implemented such a system in minisphere where games can create individual RNG streams and manage their states independently: https://github.com/fatcerberus/minisphere/blob/master/docs/sphere2-api.txt#L243-L288

At first I thought `Array.prototype.includes()` might be redundant since you can just use indexOf(), but there is a difference: includes() does a SameValue comparison whereas indexOf() uses strict equality (`===`).

With refcounting enabled, Duktape frees the object as soon as its refcount hits 0 (for local temporary objects that aren't assigned to anything else this can be as soon as...

Indeed. Refcounting doesn’t preclude the need for mark-and-sweep, it just lightens the load by freeing things inline when they can be proven by refcounting alone to be unreachable. Note that...

As an addendum to the above: in practice the only time refcounting can’t prove an object to be unreachable once it goes out of scope is in the case of...

@svaarala There was talk a while back about doing something to deal with the function prototype cycle issue... are there still plans for such an improvement?

Yes, I’m aware—it’s an inherent limitation of reference counting. It’s just that since it’s a language with first-class functions it’d be nice to have temporary functions be able to participate...