Commit Graph

262 Commits

Author SHA1 Message Date
brendan%netscape.com
93281b559a Fix switch comments, it's not a ternary node any longer. 1998-09-06 19:19:04 +00:00
brendan%netscape.com
310fe6513e - Use consistent spelling in the API: "Callback" not "CallBack" -- it's a one
word neologism, not two words.
- Use consistent neighboring terseness ("error" rather than "err" in intercaps
  identifiers).
- Don't leave pointers in JSErrorReport to freed memory if bailing on OOM in
  jscntxt.c:js_ExpandErrorArguments.
- Hanging indentation, code fusion via continue, and other misc. cleanups.
1998-09-06 08:07:35 +00:00
bjorn%netscape.com
a66b0a3f70 Added a missing read in ArenaAllocate. 1998-09-05 00:36:14 +00:00
bjorn%netscape.com
28404ccc8f Locks with almost no global locking. This will relieve contention. 1998-09-05 00:34:03 +00:00
shaver%netscape.com
9756611cdc fix ifdef breakage 1998-09-04 18:48:16 +00:00
norris%netscape.com
9ff1d1f26d Previous checkin was mistaken; back it out. 1998-09-04 00:47:22 +00:00
norris%netscape.com
984ac268fd Add support for ECMA switch statements. These are like LISP cond in that they
evaluate the case label each time.
Still to do is to optimize so that TABLESWITCH and LOOKUPSWITCH are created
when possible.
1998-09-04 00:45:21 +00:00
rogerl%netscape.com
801d3e6ac9 Removed redundant #undef 1998-09-03 22:50:55 +00:00
rogerl%netscape.com
4c0b7cffd9 New errorNumber handling.
Fixed bug #317398, for loop without condition wasn't decompiling the body
correctly since the first statement in that body was getting eaten by
mistake when trying to consume the condition expression.
1998-09-03 20:44:55 +00:00
rogerl%netscape.com
f4649b191c New errorNumber handling 1998-09-03 20:35:41 +00:00
rogerl%netscape.com
474bde20c3 New break-out of error message text from core engine 1998-09-03 20:33:32 +00:00
rogerl%netscape.com
6b0757f6fe New errorNumber handling 1998-09-03 20:29:37 +00:00
mccabe%netscape.com
30521bb1b0 Further exception work - added 'message' to the js_ErrorToException
call, and experimented with copying the original JSErrorReport into
private data.  Much of this to support a toString method for exception
objects.

It's not polished, but I wanted to get toString available quickly.
1998-09-02 20:01:34 +00:00
mccabe%netscape.com
5569d89bd7 Another platform!
Thanks go to Marc Fraioli <fraioli@dg-rtp.dg.com> for
the initial port of the js/ref standalone javascript
engine to DG/UX.
1998-09-02 08:19:31 +00:00
bjorn%netscape.com
501ca3dfad Added compare-and-swap patches for AIX (_check_lock) and Solaris (stbar). 1998-09-01 20:21:11 +00:00
shaver%netscape.com
a6a11ab6e9 if throwing, cx->exception is a valid root 1998-09-01 12:38:59 +00:00
mccabe%netscape.com
7505b29f0e restore npl. 1998-09-01 01:16:45 +00:00
mccabe%netscape.com
45051d3191 More runtime errors now bound to exceptions.
Most of these will require a second look, but I wanted to get all of
them (that need exceptions) throwing something interesting.
1998-09-01 01:15:16 +00:00
mccabe%netscape.com
91997034dc Further runtime error work... expose many new errors as catchable
exceptions.  Mostly syntax errors, so far.  Fixed missing #if
JS_HAS_ERROR_EXCEPTIONS
1998-08-31 09:49:43 +00:00
mccabe%netscape.com
25da47211e Added a call to js_ErrorToException to
the compile-error reporting mechanism,
providing a way to associate exceptions
(very likely SyntaxError exceptions)
with compile-time errors.

(Hopefully this is temporary, as I'd
prefer one central place in the
error-reporting process to put the
js_ErrorToException call.)

Also changed the error reporter in js.c
to only ignore error reports marked with
the JSREPORT_EXCEPTION advisory flag when
the error occurs during javascript execution.

If it's at the toplevel compilation
level, then the error is still reported
(and the exception discarded.)

The api is feeling slightly dirtier, but
it still seems like the best
compromise...
1998-08-31 08:17:40 +00:00
mccabe%netscape.com
b629e66f24 Added jsmsg.def to the list of files used by the
'make tar' target.
1998-08-31 07:33:13 +00:00
mccabe%netscape.com
c6028e15e4 Made the enum JSErrNum into a typedef
enum JSErrNum, and changed a uintN
errorNumber declaration to JSErrNum.

It'd be nice to change the uintN
errorNumber field in JSErrorReport to
JSErrNum, but it's not clear that
JSErrNum is or should be exposed in the
API.  Any C esthetes want to offer their
opinions?

It made my debugger slightly happier.
1998-08-31 07:07:26 +00:00
fur%netscape.com
b10cffdc67 Shane's makefiles 1998-08-29 03:04:11 +00:00
fur%netscape.com
252890a523 New file to deal with case of Java field and method with same name. 1998-08-29 03:03:51 +00:00
fur%netscape.com
bb196a6370 Error messages, in separate file for internationalization purposes. 1998-08-29 03:03:05 +00:00
fur%netscape.com
9ded12bf7a Transferred work from private ns tree back into mozilla. 1998-08-29 03:00:50 +00:00
fur%netscape.com
3700db4e0b Somehow, montulli resurrected this dead file. Killing it again. 1998-08-29 02:47:25 +00:00
fur%netscape.com
2fe3a86224 Updated Mac build instructions. 1998-08-29 02:20:24 +00:00
fur%netscape.com
8388956274 Replaced with new CodeWarrior project file macbuild/JSRef.mcp 1998-08-29 02:20:00 +00:00
mccabe%netscape.com
05b8c5f49b More loose ends towards merging the development branch. 1998-08-29 01:53:39 +00:00
mccabe%netscape.com
29ace2903c New platforms! More work from development branch. 1998-08-29 00:40:07 +00:00
mccabe%netscape.com
845c56005f Propagate lots 'o work from the development branch.
Including:

Preliminary work on internationalizing error messages

Preliminary work on exposing runtime errors as catchable exceptions

ECMA-proposed throw and try/catch/finally, with multiple catch clauses
and catchguards

ECMA-proposed in/instanceof operators

IEEE-conformant number to string conversion

Fixes and other good stuff.
1998-08-29 00:38:43 +00:00
brendan%netscape.com
ba2ce62f00 Fix funky whitespace. 1998-08-27 01:48:25 +00:00
shaver%netscape.com
52c57fa8ce JS_ConstructObject: fill NULL proto/parent like JSOP_NEW would 1998-08-26 06:14:55 +00:00
brendan%netscape.com
84f02d394d Fix typos, white-space, and layout style nits. 1998-08-25 08:22:27 +00:00
brendan%netscape.com
06db42fb38 Propagate js/src back-out of fur's incompatible closure version-check mod. 1998-08-25 08:21:55 +00:00
brendan%netscape.com
3e606b67c1 Propagate warren's OJI-related XP_MAC pragma change from js/src. 1998-08-25 08:21:09 +00:00
brendan%netscape.com
1031f4fd6d Fix nits. 1998-08-25 07:56:42 +00:00
cls%seawood.org
84f1cedcbb AUTOCONF_1_0 landing. 1998-08-19 20:42:14 +00:00
mccabe%netscape.com
8ae7434b2b Towards running w/o crashing on alpha linux; add -mieee flag to ask
the compiler to puhleeze let us used denormalized floating point
values, as required by the ECMA spec.  Thanks to various contributors,
including Torsten R�ger <torsten@ponton-hamburg.de>, for working on
numeric issues.  Fix courtesy wtc.
1998-08-12 22:09:21 +00:00
mccabe%netscape.com
acf486a530 modified #if from __alpha to __osf__, because Alpha/Linux also runs on
an alpha processor, and we really want to know osf instead.  Courtesy
wtc.
1998-08-12 19:45:04 +00:00
shaver%netscape.com
9a3213a374 added JSVersion JSVERSION_1_4 1998-08-01 19:43:23 +00:00
mccabe%netscape.com
7596bde975 Propagating work and bug fixes from
development branch:

- Preliminary exception handling per
ECMA proposal; try, multiple
catchblocks, and finally.  Catchblocks
are of the form catch (v) or
catch(v:<guard>), where guard is an
optional boolean expression that is
evaluated to determine whether the
exception is to be caught by that block.

- ECMA-proposed 'in' operator; "'foo' in
o" or "4 in o" asks if o has property
foo or element 4.

- Added a new set of defines in
jsconfig.h for js 1.4
features-in-progress.  (in, instanceof,
exception handling.)  Default build
version is now 1.4.  Fixed a few
conditional features that had become
broken.

- Progress towards porting to FreeBSD
and Alpha; casts of NaN and friends to
int are a little more localized.  Not
there yet...

- New config files to compile on more
OSes; various fixes to improve
portability.
1998-07-30 23:46:29 +00:00
mccabe%netscape.com
f0d7459661 Added NPL. 1998-07-30 23:44:39 +00:00
mccabe%netscape.com
e1c6f3374e typedef of int64 for osf now avoids long long - because long long is a
compiler extension, and we want to be able to turn off compiler
extensions for osf.  And longs are long long there anyway.

Propagated from nspr, courtesy wtc.
1998-07-24 23:12:09 +00:00
mccabe%netscape.com
10de6cce72 added some more #if JS_HAS_SHARP_VARS checks so towards compiliation
under version 120 in jsconfig.h.  Other fixes needed, though...
1998-07-17 21:18:41 +00:00
mccabe%netscape.com
c9b0c7d348 Fixed #ifdef to #if for various features defined in jsconfig.h -
JS_HAS_IN_OPERATOR, and JS_HAS_INITIALIZERS.
1998-07-17 20:46:12 +00:00
mccabe%netscape.com
2f3902fe81 Fixed interpretation of JSOP_IN to match our ECMA proposal - throw a
runtime error if the RHS is not an object.
1998-07-17 19:10:46 +00:00
mccabe%netscape.com
2082db86d6 Modified grammar for for/in and the in operator to exclude parsing the
'in' keyword as an operator in the init clause of for loops; this
disambiguates for/in loop parsing.  (Previously, there was some
treenode examination magic going on.)  Per recent ECMA submission.
1998-07-17 02:56:04 +00:00
mccabe
51247013fe Added configuration section for js 1.4, with in/instanceof/exceptions turned
on.  (Default configuration is still 1.3.)
1998-07-15 03:00:24 +00:00
shaver
4fe59b0a91 support int JSVALs in XDRValue (duh) 1998-07-13 16:12:41 +00:00
mccabe
748a690fa2 Added newline in 2nd comment to make the LXR indexer slightly happier.
Thanks to Dawn Endico <dawn@cannibal.mi.org> for LXR hacking.
1998-07-10 02:13:17 +00:00
mccabe
0d458b9d77 Changed the definition of JSDOUBLE_IS_INT(d, i) to delay a (jsint)d
cast until after the double in question has been determined to be
finite, not NaN, etc.  This may make the code a little more XP for
platforms like BSD and Alpha Linux that don't like casting strange
values to int.  Thanks go to Uncle George <gatgul@voicenet.com> and
hankin <hankin@consultco.com> for their porting work.
1998-07-08 07:56:43 +00:00
mccabe
284d1c6f30 Made the assign hack conditional on JSVERSION_IS_ECMA. 1998-07-07 23:59:45 +00:00
shaver
be9d53fcab tentative and likely useless script verifier for XDR (-DJS_XDR_SCRIPT_VERIFIER) 1998-07-04 19:45:46 +00:00
fur
1c64bf7ca6 These files were moved to js/ref/liveconnect/macbuild/JavaSession. 1998-07-03 19:00:59 +00:00
fur
6d818b7095 + Fixed heap corruption caused by free'ing of an uninitialized pointer.
+ Changed the way JS wrapper functions for Java instance methods are constructed.

  Previously, these were computed the first time that an instance method was
  accessed for a particular JavaObject and cached in the native, private portion
  of that JavaObject.  However, the required call to JS_AddRoot() causes an root
  to appear as a link in a cyclical graph, leading to uncollectible objects, i.e.
  the JavaObject has a root pointer to the function object and the function has
  a parent that points back to the JavaObject.  Now, we compute the functions
  at the time a class is reflected and use JS_CloneFunctionObject() each time
  a JS wrapper function is needed, which is slower, but avoids this GC problem.
1998-07-03 15:50:16 +00:00
fur
00108b9f51 Tweaked comment. 1998-07-03 02:43:34 +00:00
fur
f3814769e7 Fix Win32 warnings that were introduced as a result of curing Mac warnings. 1998-07-03 02:42:16 +00:00
fur
4a2e6cfaaf Got rid of debug printf(). 1998-07-03 02:41:31 +00:00
fur
330b4a6f8e Added Compatibility discussion.
Tweaked Mac build instructions.
1998-07-03 02:40:48 +00:00
fur
0d6b7f4c5f Fixed incorect argument type in jlong_to_jdouble() which was causing Java long values to get mangled. 1998-07-03 00:00:15 +00:00
fur
7e5dbbafb6 Use Types.h instead of more modern MacTypes.h so that we can build with CodeWarrior 2 on the Mac. 1998-07-02 04:11:53 +00:00
montulli
baa6d6585c merge montulli1 branch with tip 1998-07-02 02:39:54 +00:00
beard
14d7539139 Fixed unintended assignment warning in lookup_member_by_id. 1998-07-01 18:58:29 +00:00
beard
8f133a80c6 Fixed unintended assignment warning in access_java_array_element. 1998-07-01 18:55:49 +00:00
beard
6989e9ce94 Added prototype for jsj_ConvertJavaStringToJSString. 1998-07-01 18:48:12 +00:00
beard
b0adf38f64 enter_js now static, since it had no external prototype. 1998-07-01 18:47:26 +00:00
beard
9e5e0d2d68 define_JavaPackage now static since it had no external prototype. 1998-07-01 18:46:23 +00:00
beard
4b456772a7 JavaObject_getObjectOps now static since it had no external prototype. 1998-07-01 18:45:32 +00:00
beard
fe61d4682c JavaClass_getObjectOps, jsj_new_JavaClass now static, since they had no external prototypes anyway. 1998-07-01 18:44:50 +00:00
beard
111e7ffc34 Made JavaArray_getObjectOps static to fix no prototype warning. 1998-07-01 18:43:16 +00:00
beard
1cc4de3558 Fixed unintended assignment warnings, made default_map_java_object_to_js_object static to fix no prototype warning. 1998-07-01 18:42:27 +00:00
beard
d0534b637a Removed some dead code. 1998-07-01 18:37:43 +00:00
fur
1bb1ec2907 If the same JSObject is reflected into Java more than once then we should
return the same Java object, both for efficiency and so that the '=='
operator works as expected in Java when comparing two JSObjects.
However, it is not possible to hold a reference to a Java object without
inhibiting GC of that object, at least not in a way that is portable
to all vendor's JVMs, i.e. a weak reference. So, for now, JSObject identity
is broken.
1998-07-01 06:11:39 +00:00
fur
906b904d7a Added equals() method to override java.lang.Object.equals(). This is
necessary because the '==' operator won't work with LC2.
1998-07-01 06:00:10 +00:00
brendan
733ea0c9f5 - Remove duplicate error fprintf from js.c:Load.
- Revise exception handling runtime info (now called trynotes a la srcnotes)
  for more efficient loop control under JSOP_THROW.  Avoid all uses of catch
  and throw while at it, to make C++ lusers happy.
- Combine JSStackFrame.exception with rval, and rename
  JSStackFrame.exceptPending to be ...throwing.
- Optimize JS_TypeOfValue a bit.
- Name, control flow, whitespace, etc. cleanup.
1998-07-01 02:12:45 +00:00
beard
5cae9cf967 Changed jsj_HashJavaObject to conform to JSJHashFunction. 1998-07-01 00:21:18 +00:00
beard
3237061bc8 #defined PR_IMPLEMENT for XP_MAC/XP_UNIX cases. 1998-06-30 22:18:23 +00:00
beard
ed37469a20 Fixed JSVAL_TO_JLONG_JVALUE macro for XP_MAC -- can't assign 0 directly to a jlong. 1998-06-30 22:17:19 +00:00
beard
e1acf242ee Added jsj_hash.c, turned on debugging by default. 1998-06-30 22:15:38 +00:00
fur
e9e7749b27 = Replicate the JS engine machinery that gives the appearance of converting
all element access expressions to strings, e.g. so that obj["3"] and
  obj[3] refer to the same property for a JavaArray object.

= Return false when using 'delete' operator on JavaArray objects.
1998-06-30 18:18:03 +00:00
fur
bca1b5126d Return false when using the 'delete' operator on JavaClass or JavaObject objects. 1998-06-30 18:10:14 +00:00
fur
4feb603992 Eliminated the last uses of the JNIEnv global variable. Unfortunately, this
means that we had to switch from using NSPR hash tables to a private version.
The new jsj_hash.c file is derived from plhash.c, but it provides for an additional
argument to be passed to the hash key comparison function.  This capability
is used to pass in the JNIEnv pointer.

On shutdown, LiveConnect now removes all references to Java objects and classes,
so that the JVM might be able to GC them.
1998-06-30 10:04:32 +00:00
norris
7290174189 (Not part of Communicator build.)
fur's fix for repeating properties in enumeration bug.
1998-06-29 22:01:22 +00:00
norris
98f610114f (Not part of Communicator build.)
Handle NaNs better for non-PC platforms as well.
1998-06-29 22:00:11 +00:00
fur
3b5246d547 Aggressively track and release JNI local references to constructed
Java objects, because otherwise at least one JVM is reticent about
GC'ing them.
1998-06-28 07:53:04 +00:00
fur
4f4552540c = Force result to zero when converting JS NaN to Java integral types.
= Aggressively track and release JNI local references to constructed
  Java objects, because otherwise at least one JVM is reticent about
  GC'ing them.
1998-06-28 07:52:23 +00:00
fur
1a53251e00 Added toString() method for JavaPackage objects. 1998-06-28 07:51:27 +00:00
fur
20e42dfcd9 Property deletion should be silent for ECMA-conformant versions of JS. 1998-06-28 07:50:47 +00:00
fur
9b0324a6af Property deletion should be silent for ECMA-conformant versions of JS. 1998-06-28 07:39:58 +00:00
beard
f2facc58ec Added code that guarantees MRJ will be shutdown when the program exits. 1998-06-27 18:24:26 +00:00
fur
7d5c31a853 Tweaked error messages and comments. 1998-06-26 06:46:15 +00:00
fur
f30274d34b Store overloaded methods in the same order as they arrive from the JVM, so
that overloaded method resolution works the same as before, although probably
only with the Sun JVM, because this order isn't specified anywhere.
1998-06-26 06:45:04 +00:00
fur
dccdac01c8 When running in ECMA-compatibility mode, silently ignore attempts to delete
properties of JavaArray objects.
1998-06-26 05:44:02 +00:00
mccabe
c7340ec4e6 (Not part of the client build.)
Parenthesized assignment-in-conditional to quiet gcc compiler warning.
1998-06-25 18:36:53 +00:00
mccabe
ce49fb6841 Extend #ifdef SHELL_HACK from recent fix to 187538 (mistakenly 187537)
to avoid compiler warning on defined-but-unused 'Exec'.
1998-06-25 18:34:13 +00:00
norris
7176fc63e1 (Not part of Communicator build.)
Fix GC bug involving load().
1998-06-25 15:56:19 +00:00
spider
cb94dae31e NORMANDY_DDAY merge... 1998-06-25 05:50:45 +00:00
mccabe
7553565194 Fix to 187537. The 'assign' hack was interacting with the 'shell
command' hack - the resolver defined by js.c would get called to look
up 'assign' - and on Irix systems, it would find the 'assign' command
in the current path, and decide to define a function called 'assign'
in the global object that would run the assign command.  Then when an
attempt was made to assign a property to the global object, the assign
command would get run, and unexpected behavior followed.
1998-06-25 02:07:13 +00:00