bug in the MS JScript engine? 
Author Message
 bug in the MS JScript engine?

It looks like there is a bug in the MS JScript engine. It does not support
functions with multiple out values. It can't fetch the outvalues, only the
returnvalue.

The following is an idl example:
HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out, retval]
BSTR *retval );

This works under VBScript but not JScript. Of course C++ and VB works as
well.

PS! Using an idl with [in, out] does not change anything.

with regards
 Kjetil Kristoffer Solberg



Sat, 12 Jul 2003 02:00:12 GMT  
 bug in the MS JScript engine?
It's not a bug...  It is simply the way JScript works (per the ECMAScript specs I would assume).
JScript.NET (aka JScript 7.0) will support by reference arguments.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



Quote:
> It looks like there is a bug in the MS JScript engine. It does not support
> functions with multiple out values. It can't fetch the outvalues, only the
> returnvalue.

> The following is an idl example:
> HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out, retval]
> BSTR *retval );

> This works under VBScript but not JScript. Of course C++ and VB works as
> well.

> PS! Using an idl with [in, out] does not change anything.

> with regards
>  Kjetil Kristoffer Solberg




Sat, 12 Jul 2003 02:57:09 GMT  
 bug in the MS JScript engine?
I'm not shure it's not a bug. I have run through the ECMA standard and could
not find what you indicated. I may have
missed it, but I would like to hear what Microsoft says.

Kjetil Kristoffer Solberg
System Developer


Quote:
> It's not a bug...  It is simply the way JScript works (per the ECMAScript

specs I would assume).
Quote:
> JScript.NET (aka JScript 7.0) will support by reference arguments.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --



> > It looks like there is a bug in the MS JScript engine. It does not
support
> > functions with multiple out values. It can't fetch the outvalues, only
the
> > returnvalue.

> > The following is an idl example:
> > HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out, retval]
> > BSTR *retval );

> > This works under VBScript but not JScript. Of course C++ and VB works as
> > well.

> > PS! Using an idl with [in, out] does not change anything.

> > with regards
> >  Kjetil Kristoffer Solberg




Sat, 12 Jul 2003 17:25:37 GMT  
 bug in the MS JScript engine?
Then let's just say it's documented JScript behavior (and is probably consistent with Netscape's
Javascript implementations of ECMAScript)...

Copying, Passing, and Comparing Data
http://msdn.microsoft.com/scripting/jscript/doc/valref.htm

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--



Quote:
> I'm not shure it's not a bug. I have run through the ECMA standard and could
> not find what you indicated. I may have
> missed it, but I would like to hear what Microsoft says.

> Kjetil Kristoffer Solberg
> System Developer



> > It's not a bug...  It is simply the way JScript works (per the ECMAScript
> specs I would assume).
> > JScript.NET (aka JScript 7.0) will support by reference arguments.

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > > It looks like there is a bug in the MS JScript engine. It does not
> support
> > > functions with multiple out values. It can't fetch the outvalues, only
> the
> > > returnvalue.

> > > The following is an idl example:
> > > HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out, retval]
> > > BSTR *retval );

> > > This works under VBScript but not JScript. Of course C++ and VB works as
> > > well.

> > > PS! Using an idl with [in, out] does not change anything.

> > > with regards
> > >  Kjetil Kristoffer Solberg




Sat, 12 Jul 2003 23:06:24 GMT  
 bug in the MS JScript engine?
Why don't we just say that Microsoft should have implemented such a basic
functionality. Implementing it in
VBScript should have given them a clue. We should also be able to have [out]
arguments of any automation
data type, not just VARIANT. And VB should not experience memory leaks with
returntypes of just [out]
instead of [in, out]. They have made 4 service packs, more than enough time
to fix it.

No need to have an implementation weakness when we don't need to have one. I
pay lots of money for
Microsoft products and so I feel I can demand this. I don't hate Microsoft,
I live making things work on
Microsoft Systems and with Microsoft development tools.

regards
 Kjetil Kristoffer Solberg


Quote:
> Then let's just say it's documented JScript behavior (and is probably

consistent with Netscape's
Quote:
> Javascript implementations of ECMAScript)...

> Copying, Passing, and Comparing Data
> http://msdn.microsoft.com/scripting/jscript/doc/valref.htm

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --



> > I'm not shure it's not a bug. I have run through the ECMA standard and
could
> > not find what you indicated. I may have
> > missed it, but I would like to hear what Microsoft says.

> > Kjetil Kristoffer Solberg
> > System Developer



> > > It's not a bug...  It is simply the way JScript works (per the
ECMAScript
> > specs I would assume).
> > > JScript.NET (aka JScript 7.0) will support by reference arguments.

> > > --
> > > Michael Harris
> > > Microsoft.MVP.Scripting
> > > --

> > > Please do not email questions - post them to the newsgroup instead.
> > > --



> > > > It looks like there is a bug in the MS JScript engine. It does not
> > support
> > > > functions with multiple out values. It can't fetch the outvalues,
only
> > the
> > > > returnvalue.

> > > > The following is an idl example:
> > > > HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out,
retval]
> > > > BSTR *retval );

> > > > This works under VBScript but not JScript. Of course C++ and VB
works as
> > > > well.

> > > > PS! Using an idl with [in, out] does not change anything.

> > > > with regards
> > > >  Kjetil Kristoffer Solberg




Sun, 13 Jul 2003 01:08:58 GMT  
 bug in the MS JScript engine?
Whether or not you consider it a bug, JScript works the way it does by
design. Maybe it doesn't seem like the best way to do it, but it is part of
the ECMA specification for the language (section 10.1.8, specifying an
arguments object which has it's own properties that are copies of the
original parameters, not references to them). We follow the ECMA spec.
VBScript is our own language (no industry standard), so we add features we
think will be useful, such as support for calling by reference, but we don't
have that luxury with JScript.

Mike Whalen
Windows Script Dev



Quote:
> Why don't we just say that Microsoft should have implemented such a basic
> functionality. Implementing it in
> VBScript should have given them a clue. We should also be able to have
[out]
> arguments of any automation
> data type, not just VARIANT. And VB should not experience memory leaks
with
> returntypes of just [out]
> instead of [in, out]. They have made 4 service packs, more than enough
time
> to fix it.

> No need to have an implementation weakness when we don't need to have one.
I
> pay lots of money for
> Microsoft products and so I feel I can demand this. I don't hate
Microsoft,
> I live making things work on
> Microsoft Systems and with Microsoft development tools.

> regards
>  Kjetil Kristoffer Solberg



> > Then let's just say it's documented JScript behavior (and is probably
> consistent with Netscape's
> > Javascript implementations of ECMAScript)...

> > Copying, Passing, and Comparing Data
> > http://msdn.microsoft.com/scripting/jscript/doc/valref.htm

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > > I'm not shure it's not a bug. I have run through the ECMA standard and
> could
> > > not find what you indicated. I may have
> > > missed it, but I would like to hear what Microsoft says.

> > > Kjetil Kristoffer Solberg
> > > System Developer



> > > > It's not a bug...  It is simply the way JScript works (per the
> ECMAScript
> > > specs I would assume).
> > > > JScript.NET (aka JScript 7.0) will support by reference arguments.

> > > > --
> > > > Michael Harris
> > > > Microsoft.MVP.Scripting
> > > > --

> > > > Please do not email questions - post them to the newsgroup instead.
> > > > --



> > > > > It looks like there is a bug in the MS JScript engine. It does not
> > > support
> > > > > functions with multiple out values. It can't fetch the outvalues,
> only
> > > the
> > > > > returnvalue.

> > > > > The following is an idl example:
> > > > > HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out,
> retval]
> > > > > BSTR *retval );

> > > > > This works under VBScript but not JScript. Of course C++ and VB
> works as
> > > > > well.

> > > > > PS! Using an idl with [in, out] does not change anything.

> > > > > with regards
> > > > >  Kjetil Kristoffer Solberg




Sun, 13 Jul 2003 03:19:56 GMT  
 bug in the MS JScript engine?
I'm pleased with your reply. It's just that the ECMA spec. does not support
COM. This is
a Microsoft extension to the language.

 If you create an extension to the language so that you can support COM, why
only do this half way. You are creating an extension anyway, why adhere to
the
rules of the ECMA spec., for arguments, on a function call to an extension
of
the original language. You don't have to in this case, and you will still be
in
100% compliance with the ECMA spec.

If this feature is implemented, it will boost the probability of having a
future version
of the ECMA spec. supporting COM, and that is something that should please
Microsoft.

I hope Microsoft will implement this feature.

with regards
 Kjetil Kristoffer Solberg



Quote:
> Whether or not you consider it a bug, JScript works the way it does by
> design. Maybe it doesn't seem like the best way to do it, but it is part
of
> the ECMA specification for the language (section 10.1.8, specifying an
> arguments object which has it's own properties that are copies of the
> original parameters, not references to them). We follow the ECMA spec.
> VBScript is our own language (no industry standard), so we add features we
> think will be useful, such as support for calling by reference, but we
don't
> have that luxury with JScript.

> Mike Whalen
> Windows Script Dev



> > Why don't we just say that Microsoft should have implemented such a
basic
> > functionality. Implementing it in
> > VBScript should have given them a clue. We should also be able to have
> [out]
> > arguments of any automation
> > data type, not just VARIANT. And VB should not experience memory leaks
> with
> > returntypes of just [out]
> > instead of [in, out]. They have made 4 service packs, more than enough
> time
> > to fix it.

> > No need to have an implementation weakness when we don't need to have
one.
> I
> > pay lots of money for
> > Microsoft products and so I feel I can demand this. I don't hate
> Microsoft,
> > I live making things work on
> > Microsoft Systems and with Microsoft development tools.

> > regards
> >  Kjetil Kristoffer Solberg



> > > Then let's just say it's documented JScript behavior (and is probably
> > consistent with Netscape's
> > > Javascript implementations of ECMAScript)...

> > > Copying, Passing, and Comparing Data
> > > http://msdn.microsoft.com/scripting/jscript/doc/valref.htm

> > > --
> > > Michael Harris
> > > Microsoft.MVP.Scripting
> > > --

> > > Please do not email questions - post them to the newsgroup instead.
> > > --



> > > > I'm not shure it's not a bug. I have run through the ECMA standard
and
> > could
> > > > not find what you indicated. I may have
> > > > missed it, but I would like to hear what Microsoft says.

> > > > Kjetil Kristoffer Solberg
> > > > System Developer



> > > > > It's not a bug...  It is simply the way JScript works (per the
> > ECMAScript
> > > > specs I would assume).
> > > > > JScript.NET (aka JScript 7.0) will support by reference arguments.

> > > > > --
> > > > > Michael Harris
> > > > > Microsoft.MVP.Scripting
> > > > > --

> > > > > Please do not email questions - post them to the newsgroup
instead.
> > > > > --



> > > > > > It looks like there is a bug in the MS JScript engine. It does
not
> > > > support
> > > > > > functions with multiple out values. It can't fetch the
outvalues,
> > only
> > > > the
> > > > > > returnvalue.

> > > > > > The following is an idl example:
> > > > > > HRESULT GetData( [out] VARIANT *out1, [out] VARIANT *out2, [out,
> > retval]
> > > > > > BSTR *retval );

> > > > > > This works under VBScript but not JScript. Of course C++ and VB
> > works as
> > > > > > well.

> > > > > > PS! Using an idl with [in, out] does not change anything.

> > > > > > with regards
> > > > > >  Kjetil Kristoffer Solberg




Sun, 13 Jul 2003 18:23:16 GMT  
 bug in the MS JScript engine?


Quote:
> I'm pleased with your reply. It's just that the ECMA spec. does not
support
> COM. This is
> a Microsoft extension to the language.

The ECMA spec neither supports nor doesn't support COM.  ECMAScript is just
a general purpose scripting language.  Providing a mechanism for
instantiating objects (ActiveXObject) is in keeping with that standard.
Providing a way of wrapping scrips in XML is in keeping with that standard
(well -- it would be nice if MS followed the ECMA way of wrapping scripts in
XML, as per ECMA-290, but it's not mandatory; they're free to provide
whatever wrapper mechanism they want).  Providing a way of calling those
scripts (as COM components) is in keeping with that standard.

Altering how the language worked so that it supported passing by reference
would not be in keeping with the standard.

It's one thing to provide extra objects or expose the script in a particular
manner -- it's quite another to change how the language actually works.

Quote:
>  If you create an extension to the language so that you can support COM,
why
> only do this half way. You are creating an extension anyway, why adhere to
> the
> rules of the ECMA spec., for arguments, on a function call to an extension
> of
> the original language. You don't have to in this case, and you will still
be
> in
> 100% compliance with the ECMA spec.

Because it'd be changing how the language worked.  The spec doesn't forbid
one from creating, e.g., a COM wrapper (so that the script is a COM
component), nor from having e.g. new objects (to instantiate other
components), because these things don't change how the language works.
Having some form of "by reference" passing *would* change how the langugage
worked.

Quote:
> If this feature is implemented, it will boost the probability of having a
> future version
> of the ECMA spec. supporting COM, and that is something that should please
> Microsoft.

I would imagine there's a reasonable chance of ECMAScript 4 having such a
feature anyway.

--

Now Playing:  Super{*filter*} - Breakfast In America - 01 - Gone Hollywood.mp3



Thu, 17 Jul 2003 05:13:36 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. .toFixed() bug in MS JScript script engine

2. VB Script engine variable dec bug? (Workaround Needed)

3. questions: printers,engines,bugs

4. Beta bug (to MS team)

5. Bug in MS download package?

6. Server Side JScript engine, For FREE

7. JScript and Search Engines

8. URL - Jscript Engine performance Netscape v. IE (repost)

9. Memory Leak in JScript Engine?

10. IActiveScript Script Engine and JScript Events

11. JScript Engine Not Recognized

12. updating the client browser's JScript engine

 

 
Powered by phpBB® Forum Software