dasmurphy / base2

Automatically exported from code.google.com/p/base2
0 stars 1 forks source link

Cannot extend a Binding with an @-rule bind method #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run a base2 test in IE with a console or FirebugLite.
2. Inspect base2.DOM.Event.bind.toString()

What is the expected output? 

bind: function(event) {
  //-dean: put more fixes here
  this.base(event);
  event.target = event.srcElement;
  return event;
}

What do you see instead?

function(object) { return this(object); // cast }

What version of the product are you using? On what operating system?

Version 1.1, r14. Vista.

Please provide any additional information below.

I believe the issue is that the bind-aware implementation of extend in 
Binding can't find nested @rule versions of bind in _static, and so it 
overwrites them with this.bind.

Another way to test it is like so:

foo = base2.DOM.Binding.extend({}, {"@1":{bind:function(){extended!}}})
>> foo.bind remains Binding.bind

Original issue reported on code.google.com by scott.mi...@gmail.com on 26 Apr 2007 at 1:00

GoogleCodeExporter commented 9 years ago
Ok, the actual expected output is

function() { // override
  var previous = this.base;
  this.base = ancestor;
  var returnValue = method.apply(this, arguments);
  this.base = previous;
  return returnValue;
};

but that's not really the point. ;)

Original comment by scott.mi...@gmail.com on 26 Apr 2007 at 1:21

GoogleCodeExporter commented 9 years ago
Bind methods will be different for different browsers as each browser has a 
different
inheritance path depending on which features the browser has missing.

I don't really consider this a bug.

Original comment by dean.edw...@gmail.com on 1 May 2007 at 8:10

GoogleCodeExporter commented 9 years ago
Changed to "WontFix" (see my previous comment).

Original comment by dean.edw...@gmail.com on 1 May 2007 at 8:11

GoogleCodeExporter commented 9 years ago
Presumably, 

 event.target = event.srcElement;

is supposed to fire on IE, but it doesn't.

That's the point of the bug report. One of us is missing something. :)

Original comment by scott.mi...@gmail.com on 2 May 2007 at 1:36

GoogleCodeExporter commented 9 years ago
> One of us is missing something.

OK. The penny the penny has dropped for me. I now see the problem. :-) 
Unfortunately
I don't have a copy of Vista. Can you supply your UA string please?

I'll reopen the bug...

Original comment by dean.edw...@gmail.com on 2 May 2007 at 3:26

GoogleCodeExporter commented 9 years ago
I'm sorry that the original bug report was so obtuse. I started with "hey, IE 
event 
fix isn't working" and ended up so drilled into your code that my but report 
was 
ultra-technical. 

Fwiw, this @ rule is working well:

    "@MSIE.+win": {
        bind: function(event) {

It's just that the special code in Binding for overriding 'bind' isn't allowing 
this 
version of bind to be mixed into Event, as described above.

Here is the UA string you asked for:

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; 
.NET 
CLR 3.0.04506; .NET CLR 1.1.4322)

Original comment by scott.mi...@gmail.com on 2 May 2007 at 9:50

GoogleCodeExporter commented 9 years ago
I think this is now fixed. Can someone test it for me? Preferably Scott. :-)

Original comment by dean.edw...@gmail.com on 19 Jun 2007 at 7:23

GoogleCodeExporter commented 9 years ago
This is now fixed.

Original comment by dean.edw...@gmail.com on 3 Jul 2007 at 8:36

GoogleCodeExporter commented 9 years ago

Original comment by doek...@gmail.com on 14 Jul 2007 at 6:59