Граф коммитов

995 Коммитов

Автор SHA1 Сообщение Дата
rogerl%netscape.com 5e4cc01584 Updated internal name of exec function to match new naming rules. 1999-08-03 22:41:57 +00:00
mccabe%netscape.com 56ac346458 - Added OS_TARGET-switched definition of CLASSPATHSEP, to support building under Windows NT with GNU make. Thanks to Andew Wason <aw@softcom.com> for this fix.
- Removed outdated references to JSDEBUG_JAR.
1999-08-03 22:15:02 +00:00
norris%netscape.com 14d89e5bff Adding patch (with slight modifications for javadoc) from Andrew Wason <aw@softcom.com>:
Subject:
        Rhino reflection patch
   Date:
        Wed, 28 Jul 1999 18:14:52 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        mccabe@netscape.com, rogerl@netscape.com, Howard Lin <howard@softcom.com>




When JavaAdapter generates an adapter class, it does not take into account
the types of method parameters when wrapping the generated methods arguments.

This means that if a non-public class implements a public interface the
non-public class type will be wrapped instead of the declared public
interface - and methods cannot be invoked via the wrapper.

I have attached sample code (reflect-demo.zip) which shows this.  The
JavaScript caller.js generates an adapter implementing the CallerInterface
interface.  CallerInterface has a method (doSomething) which takes an
argument of type pkg.Interface.  pkg.Target is a non-public class that
implements pkg.Interface.  If an instance of pkg.Target is passed to the
CallerInterface adapter doSomething method, an Error is thrown because
pkg.Target.doSomething is called (instead of pkg.Interface.doSomething) and
pkg.Target is not public.

I have attached a patch to Context.java, ScriptRuntime.java and
JavaAdapter.java.  I overloaded toObject in Context and ScriptRuntime to
take a 3rd argument which is the declared type of the object being
wrapped.  This is passed to NativeJavaObject.wrap so that it generates the
correct wrapper. I changed JavaAdapter.generateOverride to generate
bytecode calling Context.toObject passing the declared Class type of the
argument.

Context.java also includes my previously submitted patch for dealing with
SecurityExceptions and the JavaAdapter property (because this patch has not
been checked into CVS yet).

Andrew

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   reflect-patch.txt

                Name:
                      reflect-patch.txt
                 Type:
                      Plain Text (text/plain)




   reflect-demo.zip

                   Name:
                         reflect-demo.zip
                    Type:
                         Zip Compressed Data (application/x-zip-compressed)
                Encoding:
                         base64
1999-08-03 21:24:39 +00:00
norris%netscape.com e48746d3bd Remove unused clone() method. 1999-08-03 20:40:25 +00:00
rogerl%netscape.com 49598375a1 Fixed test cases for non-global regexp. case - the result array should be
exactly the same as that returned by simply 'exec'ing the regexp against
the input string.
1999-08-03 00:51:23 +00:00
mccabe%netscape.com 71d9e10c3c Further fix to properly include classes from the org.mozilla.classfile package in the generated .jar file.
Thanks to Andrew Wason <aw@softcom.com> for his continued work on the Rhino make system.
1999-08-03 00:25:30 +00:00
mccabe%netscape.com 3824e4ce66 Add the classes defined in org/mozilla/classfile to js.jar. 1999-08-02 09:01:19 +00:00
jband%netscape.com 1e78c7d4c9 fix for bug 10998 pointed out by rginda@ix.netcom.com. This was really just a refcounting bug 1999-07-31 18:53:40 +00:00
briano%netscape.com b1ebcd6eb3 OpenVMS-specific addition to force a POSIX build of jscpucfg. 1999-07-31 00:38:25 +00:00
jband%netscape.com dce27dd602 1) fix the xpconnect factories to not use static objects.
2) add a test that acts as a sample for doing oberloaded methods on xpconnect wraped natives.
3) add a NOT_IMPLEMENTED method to wrapped native for getting the prototype JS object.
4) Set the global object of the JSContext as the wrapped native JSObject's parent when creating this JSObject. This makes JS code compiled against the wrapper actuall work!
5) fix the refcounting on factories in the tests/components module
1999-07-31 00:26:35 +00:00
jband%netscape.com e118451581 copy in most of the better error reporter from js.c 1999-07-31 00:19:50 +00:00
briano%netscape.com ea37bbc00a Trivial elimination of some pointless macros as discussed in bug 8568. Approved by leaf@mozilla.org. 1999-07-29 01:18:12 +00:00
brendan%mozilla.org 2ac2a0d840 Fix warnings reported at http://tinderbox.mozilla.org/SeaMonkey/warnings.html, mostly unsigned/signed bothers. 1999-07-28 06:48:44 +00:00
briano%netscape.com d99daeea9b Cleaned it up and changed the name of libreg.{a,so} to libmozreg.{a,so} to fix the conflict reported in bug 8568. 1999-07-27 23:27:44 +00:00
waldemar%netscape.com 89d2f00c13 Updated for recent semantic engine changes. Changed the meaning of (?= to match Perl. 1999-07-27 01:05:59 +00:00
waldemar%netscape.com a47778dc21 Updated for recent semantic engine changes 1999-07-27 01:05:27 +00:00
waldemar%netscape.com e44b2fd3a0 Implemented partial order for operator precedences. Removed global array functions and reformatted 'length' and 'empty' functions. 1999-07-27 01:03:19 +00:00
waldemar%netscape.com b58090bf41 Implemented partial order for operator precedences. Removed global array functions and reformatted 'length' and 'empty' functions. Made lexer-actions into global function calls. 1999-07-27 01:02:21 +00:00
waldemar%netscape.com 06b9b1e365 Made lexer-actions into global function calls 1999-07-27 01:00:05 +00:00
waldemar%netscape.com 661e147d86 Added partial order library 1999-07-27 00:58:44 +00:00
waldemar%netscape.com 0c4a9632a2 Replaced :unit by :empty-10 1999-07-27 00:58:01 +00:00
waldemar%netscape.com bb32acd59c First Checked In. 1999-07-27 00:57:03 +00:00
mccabe%netscape.com 01f06bc645 Fix code to invoke Wrapper interfaces using INVOKEINTERFACE rather than INVOKEVIRTUAL.
Thanks go to Andrew Wason <aw@softcom.com> for finding this problem and providing the patch:



If we implement a Java interface in JavaScript, and a method in that interface returns a Java object, we get a java.lang.IncompatibleClassChangeError: org/mozilla/javascript/Wrapper  exception.

We have attached a sample JavaScript file which duplicates the error.

The problem is JavaAdapter is generating an INVOKEVIRTUAL bytecode to call Wrapper.unwrap, but Wrapper is an interface and so INVOKEINTERFACE should be used instead.  As a result of this change, the IFEQ bytecode generated needs to jump more bytes.  We have attached a patch that fixes the problem.

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-07-26 10:45:38 +00:00
mccabe%netscape.com 05ad44c9f8 Added NPL. 1999-07-26 10:41:46 +00:00
mccabe%netscape.com 4ebeecff4e Comment fixes.
- normalized initial MPL comment to match the format of others in the tree, including an initial -*- Mode line.

- removed RCS $log$, etc. comments.  We use CVS, and they just make spurious changes...
1999-07-26 10:40:53 +00:00
brendan%mozilla.org bf87ed2da8 Eliminate warning about unsigned/signed == comparison. 1999-07-23 08:24:35 +00:00
brendan%mozilla.org a82fcf9479 Add new flag to js_DecompileValueGenerator calls. 1999-07-23 08:22:12 +00:00
brendan%mozilla.org 892c6a80d1 Bugs, bugs bugs:
- js_DecompileValueGenerator had rusted due to bytecode/source-note changes,
  or maybe parts of it never worked right.  Anyway, it now does not induce a
  crashing underflow in the decompiler.  As part of this fix, it now takes a
  checkStack flag telling whether to look for the jsval v argument on the JS
  stack.  The calls from ImportProperty, js_SetProperty, and js_DeleteProperty
  pass in v a jsval for the property id, which should not be sought after on
  the stack (it might happen to be there due to o['p'] = 2, but we want to
  decompile o["p"], not "p").
- js_DecompileValueGenerator would load a generating pc even if the value v
  did not match the pc's corresponding stack item!  Oops.  This lead to less
  than idea diagnostics.
- js_DecompileValueGenerator was also not mapping JSOP_TRAP to the real op at
  a sufficiently early and univeral point in its control flow.
- Fix PopOff to assert and check for stack underflow in the decompiler, and
  beef up PushOff too (it asserted, but did not check).
- js_ReportIsNotFunction now avoids JS_InternString by indexing directly into
  cx->runtime->atomState.typeAtoms with the result of JS_TypeOfValue.
- Removed unnecessary local GC root reserved by non-zero trailing member of
  obj_eval's JSFunctionSpec initializer.
1999-07-23 08:01:54 +00:00
mccabe%netscape.com f88d4c4862 Fix warnings flagged by the auto-warnings page http://tinderbox.mozilla.org/SeaMonkey/warnings.html . Thanks slamm. 1999-07-22 10:36:23 +00:00
mccabe%netscape.com 44c1aa3958 Changes to support building on Alpha NT.
Patches courtesy bob meader <bob@guiduck.com> who seems to be working fast and furious on this port.
1999-07-22 03:58:51 +00:00
cbegle%netscape.com 1e355189af fixed a versioning problem with the tests. these should succeed now.
these files files have no impact on the mozilla build.
1999-07-21 19:20:02 +00:00
cbegle%netscape.com 85da0ba851 *** empty log message *** 1999-07-21 18:02:34 +00:00
cbegle%netscape.com 5b6edba7cc update shared functions file.
this is not part of the mozilla client build, and has no effect on its
bustedness.
1999-07-20 18:00:13 +00:00
cbegle%netscape.com 899e0d5d83 adding file for running tests in the driver. 1999-07-20 17:49:01 +00:00
Jerry.Kirk%Nexwarecorp.com c80aa6b941 Defined DASH_R for Neutrino 1999-07-19 21:18:19 +00:00
jband%netscape.com 1af850b898 enabling xpconnect for Linux ARM because we now have xptcall code for Linux ARM from Stefan Hanske <sh990154@mail.uni-greifswald.de> 1999-07-19 02:59:21 +00:00
cbegle%netscape.com f80bb6aad0 the js1.2 tests really need the version(120) called.
fix regression test for #7703.

This is not part of the mozilla build and has no effect on its bustedness.
1999-07-16 21:47:51 +00:00
jband%netscape.com 5cf8d696a6 adding forward declaration test 1999-07-16 20:38:16 +00:00
jband%netscape.com 7972332b69 added files: mozilla/js/src/xpconnect/idl/xpctest2.idl 1999-07-16 20:35:58 +00:00
jband%netscape.com 5c4e62e268 adding new file for forward declaration test 1999-07-16 20:33:36 +00:00
jband%netscape.com c50f5e41ca an inout of interface pointer test that illustrates that bug 9914 is not a bug 1999-07-16 04:29:49 +00:00
jband%netscape.com 425c09247d make the const things const so that strict compilers don't complain 1999-07-16 04:23:00 +00:00
norris%netscape.com 1eb0a9e85e Add new example. 1999-07-16 03:03:20 +00:00
cbegle%netscape.com eb378fea4e Remove more recursive calls to startTest. hm..
This is not part of the mozilla build and has no effect on its bustedness.
1999-07-16 01:39:07 +00:00
cbegle%netscape.com 47f6d82edf Add a regression test case for #7224.
This is not part of the mozilla build and has no effect on build bustage.
1999-07-16 01:30:24 +00:00
cbegle%netscape.com 00f16d48ce Remove a recursive call to startTest.
This file is not part of the client build.
1999-07-16 01:25:50 +00:00
mccabe%netscape.com 140c877e02 Fix to 9523. In the javascript Date implementation, check for unsupplied date argument to new Date(year, month, date) rather than clamping it to 1 if < 1. Previously we ignored negative values for the date argument, rather than subtracting from the resulting date, as per the ECMA-262 spec. for the JavaScript language.
Thanks go to Martin Honnen <martin.honnen@sector27.de> for spotting this difference from the spec.
1999-07-16 00:50:11 +00:00
mccabe%netscape.com f54711dfb3 Fix to 9523.
Add an #if defined(__arm) check to tell jsdtoa.c about the (somewhat bizzare) endian-ness of the ARM architecture.

Thanks go to Stefan Hanske <sh990154@mail.uni-greifswald.de> for this fix.
1999-07-16 00:45:13 +00:00
rogerl%netscape.com 7d5915b747 Fixed compile time errors + minor memory allocation problems. 1999-07-15 23:37:05 +00:00
cbegle%netscape.com bf39a7e9ea Add a regression test case for #7635.
This file is not part of the client build.
1999-07-15 22:28:12 +00:00