Re: The Anthropic Side Channel (was: How would shallow generators compose with lambda?)

2009-05-27 Thread Igor Bukanov
2009/5/27 Maciej Stachowiak m...@apple.com: I'm not sure but I think maybe the Safari behavior is a bug, as the finally clause could contain another infinite loop. Indeed, if a browser respects finally clauses in the code after terminating a too long running loop, then the following would be

Re: The Anthropic Side Channel (was: How would shallow generators compose with lambda?)

2009-05-27 Thread Igor Bukanov
2009/5/27 Igor Bukanov i...@mir2.org: Indeed, if a browser respects finally clauses in the code after terminating a too long running loop, then the following would be an effective DOS: javascript:Array(1e3).join('try {')+Array(1e3).join('} finally { while (1); }'); I meant javascript:eval

Re: yield syntax (diverging from: How would shallow generators compose with lambda?)

2009-05-18 Thread Igor Bukanov
2009/5/18 Brendan Eich bren...@mozilla.com: On May 18, 2009, at 2:25 AM, Igor Bukanov wrote: The remedy for this is simple - the generator can be created using explicit call like Generator(f, arg1, ... argN). This would turn any function into a generator and would allow for runtime checks

Re: How would shallow generators compose with lambda?

2009-05-14 Thread Igor Bukanov
2009/5/14 Brendan Eich bren...@mozilla.com: function gen(arg) {    foo((lambda (x) yield x), arg); } function foo(callback, arg) {    try {        callback(arg);    } finally {        alert(I'm ok!);    } } g = gen(42); print(g.next()); // tell the user the meaning of life, etc. g =

Re: Alternative to Function.bind

2009-03-27 Thread Igor Bukanov
2009/3/27 Erik Arvidsson erik.arvids...@gmail.com: Here is one way to implement object.bind.method using ES3.1 The provided example has a drawback that obj.bind would not work with methods that are added to obj later. So it would not be the true bounded-method view for obj but rather a

Alternative to Function.bind

2009-03-22 Thread Igor Bukanov
Various current proposals for Function.bind have a drawback that in a typical situation one needs to use the reference to the object twice as in obj.method.bind(obj) This double-referencing can be avoided if bind would be applied to the object, not to the function. The result of the bind call

Re: 15.4.4.21 Array.prototype.reduce ( callbackfn [ , initialValue [ , thisArg ] ] )

2009-03-21 Thread Igor Bukanov
2009/3/21 Edward Lee edi...@mozilla.com: On Sat, Mar 21, 2009 at 11:57 AM, Brendan Eich bren...@mozilla.com wrote: ... Alternatively, we could just eliminate that extra thisObject argument,    arr.map(function(x,i,me) { return obj.method(x,i.me) }) vs arr.map(method.bind(obj) vs

Re: indirect eval spec too severe?

2009-01-23 Thread Igor Bukanov
2009/1/18 Mark S. Miller erig...@google.com: The Mountain View draft says: 15.1.2.1.1Strict Mode Restrictions If strict mode code uses the value of the eval property any way other than as a direct call (that is, other than by the explicit use of its name as an Identifier which is the

Re: Consistent decimal semantics

2008-08-26 Thread Igor Bukanov
2008/8/26 Brendan Eich [EMAIL PROTECTED]: Sam and I, not going in circles (much), agree that typeof 3m should be object, and that we add hardwired operator support for such Decimal objects. This would be very similar to QName and Namespace from E4X. typeof returns object for both but there is

Re: return when desugaring to closures

2008-08-24 Thread Igor Bukanov
2008/8/24 Brendan Eich [EMAIL PROTECTED]: I call it unnecessary to make let (x = a, y = b) {...} be shorthand for (function (x, y) {...})(a,b). Count characters: 24 vs. 28. Come on! And in the case of the let expressions using the shorthand (it is proposed for ES4 and available in FireFox 3.0)

Re: A Proposal For Formalizing __noSuchMethod__ in ECMAScript 3.1.

2008-08-19 Thread Igor Bukanov
2008/8/19 Allen Wirfs-Brock [EMAIL PROTECTED]: Some of my specific issues with the proposal that I think need further work include: Yet another issue is that __noSuchMethod__ does not work with call/apply. That is, in foo.bar.call(foo) __noSuchMethod__ is not invoked as the engine treats