Finding the first bug in the RC version

Published Wed, Dec 20 2006 7:27

in the future bits, to be more precise...

Today I was playing with profiles and xml-script and started getting an error which said object expected. It happened in the Sys.Preview.Services.ComponentsProfile method. this was a strange bug because the page was correctly loaded (ie, the profile properties were loaded from the server and the textboxes were initialized with their values). After using the debugger, i've noted that it stopped on this line:

if(methodName === "save") {
 this.save.apply(this, parameters);
}

I'm still not sure on why they're using the apply method there since a simple call like the following:

this.save(parameters);

works without any problem. well, i've changed it and i'll put a post in the forums so that it gets fixed in the final release.

Filed under: ,

Comments

# Cyril said on Wednesday, December 20, 2006 7:23 PM

I'm not sure that my previous comment was OK

this.save.apply(this, parameters); and this.save(parameters) is not equivalent

I will take an example

var foo = function(a,b,c){}

We can call it like this foo.apply(this, [1,2,3]) and this is not the same thing as foo([1,2,3]). There is also the call method : foo.call(this, 1, 2, 3)

But this is not the first bug I find this one : http://forums.asp.net/thread/1499508.aspx and I have some other issue more difficult to explain (i can send you a mail if you want)

# Luis Abreu said on Sunday, December 24, 2006 2:23 PM

hello Cyril.

Yes, i know they're different. there's a difference between making a call and performing a call and "applying" it to another object (which, btw, is the base of inheritance in the ajax client script type). what i was trying to say was that the apply doesn't make sense in that case since it's trying to perform a call and apply it to the method that it's calling. thus, in this case (and this is my opinion), the correct call should be the one i've written since the save method is being called from another member method (hope this time i've managed to explin it correctly).

btw, regarding the bug, i do recall having seen it. i'm not sure that it's a bug on the platform (i though that parsing was based on localization, but i'm not sure since in the last weeks i've been busy working on non-ASP.NET projects). if you want, you can write me a mail with that bug (and maybe others you've found?) and i promise to take a look. i don't know if i'll be able to help, but i'm really interested in finding out more about those problems.

oh, and merry christmas to you too! :)

Leave a Comment

(required) 
(required) 
(optional)
(required)