Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » JSDT: types scoping differs from browsers
JSDT: types scoping differs from browsers [message #209764] Thu, 06 March 2008 06:05 Go to next message
Eclipse UserFriend
Originally posted by: anton.safonov.gmail.com

Hi all!

Posted this to ATF first, but it might be more appropriate here.

I noticed that JSDT (tried both autumn versions and latest tags) handles
type scopes differently when compared with Firefox/IE.
Let's have such a script:
function aaa() {
var localvar = 1;
globalvar = 2;
function myclass() {
myclass.prototype.mymethod = function() {
// assist here
}
}
}

Inside the "mymethod" "localvar" is visible in the browser, but not
visible in JSDT. As far as I've found, the reason is that once there is a
'prototype' mentioned, InferEngine starts working and marks "myclass" as
an inferred type and puts its scope right under CompilationUnitScope, not
under the scope of the "aaa" function.

Is it an expected behavior and based on some standard or it is more like a
bug?
What would be the easiest "fix" for my custom build to work the way
browsers do?

Regards,
Anton Safonov
Re: types scoping differs from browsers [message #210394 is a reply to message #209764] Fri, 14 March 2008 14:41 Go to previous message
Eclipse UserFriend
Sounds like a bug. Could you report this in bugzilla against the
webtools/wst.jsdt component?

-Brad
"Anton Safonov" <anton.safonov@gmail.com> wrote in message
news:fb36fee78fe3246544a6a84013a32474$1@www.eclipse.org...
> Hi all!
>
> Posted this to ATF first, but it might be more appropriate here.
>
> I noticed that JSDT (tried both autumn versions and latest tags) handles
> type scopes differently when compared with Firefox/IE.
> Let's have such a script:
> function aaa() {
> var localvar = 1;
> globalvar = 2;
> function myclass() {
> myclass.prototype.mymethod = function() {
> // assist here
> }
> }
> }
>
> Inside the "mymethod" "localvar" is visible in the browser, but not
> visible in JSDT. As far as I've found, the reason is that once there is a
> 'prototype' mentioned, InferEngine starts working and marks "myclass" as
> an inferred type and puts its scope right under CompilationUnitScope, not
> under the scope of the "aaa" function.
>
> Is it an expected behavior and based on some standard or it is more like a
> bug?
> What would be the easiest "fix" for my custom build to work the way
> browsers do?
>
> Regards,
> Anton Safonov
>
Previous Topic:EMF XSD Parser Bug for SimpleType Definition in case of List and Union
Next Topic:War Import
Goto Forum:
  


Current Time: Tue May 06 13:35:19 EDT 2025

Powered by FUDForum. Page generated in 0.02679 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top