Proxies and observable spec algorithms

# David Bruant (13 years ago)

Today, I came across a test on Firefox test suite [1]. This test verifies that on the proxy, the traps gets called in the right order according to the ES5 algorithm of Array.prototype.splice. Seeing this test made me realize that as soon as proxy gets in the spec and implemented in web browsers, every single built-in function algorithm will be observable, so will need to be frozen while before proxies, they didn't need to (which allowed internal refactorings).

This seems to be the last time major refactorings can be applied to these algorithms. Are they ready to be frozen?

Maybe it would be worth having tests for this in test262 as an attempt to ensure interoperability for all these algorithms when used in combination with proxies?

David

[1] mxr.mozilla.org/mozilla-central/source/js/src/jit-test/tests/basic/splice-check-steps.js

# Allen Wirfs-Brock (13 years ago)

It's already the case that the ordering of most [[Put]] and [[Get]] calls in those algotitms are observable. Other internal methods are observable via attribute manipulation side-effects that cause downstream internal methods to throw.

I don't thing Proxies will make things much worse.  That said, reviews and critiques of existing algorithms are most welcome.

Allen

Sent from my Samsung Galaxy TabDavid Bruant <bruant.d at gmail.com> wrote:Hi,

Today, I came across a test on Firefox test suite [1]. This test verifies that on the proxy, the traps gets called in the right order according to the ES5 algorithm of Array.prototype.splice. Seeing this test made me realize that as soon as proxy gets in the spec and implemented in web browsers, every single built-in function algorithm will be observable, so will need to be frozen while before proxies, they didn't need to (which allowed internal refactorings).

This seems to be the last time major refactorings can be applied to these algorithms. Are they ready to be frozen?

Maybe it would be worth having tests for this in test262 as an attempt to ensure interoperability for all these algorithms when used in combination with proxies?

David

[1] mxr.mozilla.org/mozilla-central/source/js/src/jit-test/tests/basic/splice-check-steps.js

# Andreas Rossberg (13 years ago)

On 15 April 2012 00:22, David Bruant <bruant.d at gmail.com> wrote:

Today, I came across a test on Firefox test suite [1]. This test verifies that on the proxy, the traps gets called in the right order according to the ES5 algorithm of Array.prototype.splice. Seeing this test made me realize that as soon as proxy gets in the spec and implemented in web browsers, every single built-in function algorithm will be observable, so will need to be frozen while before proxies, they didn't need to (which allowed internal refactorings).

Yes, see also this thread:

esdiscuss/2011-October/017091