jim-jim-jim / base2

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

DOM Interface module does not respect conditional (using detect) implementation #122

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What version of the product are you using? On what operating system?

1.1 (alpha1)

Please provide any additional information below.

The _createDelegates(module, _interface) function unconditionally creates
the delegated methods without checking the specified condition. It contains
the following code:

if (name.indexOf("@") == 0) {
    _createDelegates(module, property);
}

May be it have to be changed to:
if (name.indexOf("@") == 0) {
    if (detect(name.slice(1))) _createDelegates(module, property);
}

which is similar to the _extendModule(module, _interface) function in base2.

Original issue reported on code.google.com by mdimitrov@gmail.com on 19 Nov 2009 at 10:15

GoogleCodeExporter commented 9 years ago
That does look like a bug.

Did you encounter a problem? Or are you just browsing the code? If you have a 
real test 
case then that would be helpful. But it looks like a bug anyway.

Original comment by dean.edw...@gmail.com on 19 Nov 2009 at 12:23

GoogleCodeExporter commented 9 years ago
Actually, no, it's not a bug. _createDelegates() will add default DOM methods. 
So it 
doesn't matter if it fails the detect() test. I'll add some comments so that it 
is 
clear.

Original comment by dean.edw...@gmail.com on 19 Nov 2009 at 12:33

GoogleCodeExporter commented 9 years ago
Sorry about this. I had some issues with ElementView.getBoundingClientRect. Then
browsing the code I stumbled upon this and thought that it might have something 
to do
with the issue. At the end I think that the problem I had with 
getBoundingClientRect
may have nothing to do with base2.

Original comment by mdimitrov@gmail.com on 26 Nov 2009 at 3:02

GoogleCodeExporter commented 9 years ago
If you are having problems with getBoundingClientRect() then let me know 
through the 
base2 google group. I tested it pretty thoroughly but there may be some 
scenarios where 
it does not work consistently. 

Original comment by dean.edw...@gmail.com on 27 Nov 2009 at 2:05