It is sound, as corrected in light of Allen's post. If the function contains a direct eval operator in its body, it also "might sense this".
On Wed, May 30, 2012 at 3:31 PM, David Herman <[email protected]> wrote: > On May 30, 2012, at 3:23 PM, Mark S. Miller wrote: > > > Independent of name, I'm trying to test for "might sense this". > > OK, but that begs the question. The problem is that your "might" test is > neither sound (as Allen pointed out) nor complete (as I pointed out) for > "can." What guarantee are you trying to provide? What do you mean by > "might?" > > I *think* the predicate people are asking for is, "does this function > behave like a method, and if I use .call/.apply with a custom receiver > object, will it use that receiver object?" That's just not something a > computable function can accurately predict. > Since we have a universal Turing language here, I am certainly not looking for accuracy, I'm looking for soundness. Thus, answering your "if I use .call/.apply with a custom receiver object, will it use that receiver object?" is equally undecidable. If you change your "will" to "might", then we're saying the same thing. The answer "it might" doesn't guarantee much -- hence incompleteness. The answer "it won't" should be a hard guarantee -- hence soundness. By additionally specifying simple rules that result in the answer "it won't", we enable programmers to predictably write non-this-sensitive functions for which the predicate will vouch for their this-insensitivity. > But I haven't read the JSFixed thread Rick mentioned, so I may have > misinterpreted. Rick, can you post a link? > > Dave > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

