260 Commits

Author SHA1 Message Date
brendan%netscape.com
40a84ecba5 Fix switch comments, it's not a ternary node any longer.
git-svn-id: svn://10.0.0.236/trunk@9457 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-06 19:19:04 +00:00
brendan%netscape.com
f85feaca03 - 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.


git-svn-id: svn://10.0.0.236/trunk@9455 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-06 08:07:35 +00:00
bjorn%netscape.com
945b841d48 Added a missing read in ArenaAllocate.
git-svn-id: svn://10.0.0.236/trunk@9398 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-05 00:36:14 +00:00
bjorn%netscape.com
c4ef934afe Locks with almost no global locking. This will relieve contention.
git-svn-id: svn://10.0.0.236/trunk@9397 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-05 00:34:03 +00:00
shaver%netscape.com
952f75d830 fix ifdef breakage
git-svn-id: svn://10.0.0.236/trunk@9355 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-04 18:48:16 +00:00
norris%netscape.com
e41858a470 Previous checkin was mistaken; back it out.
git-svn-id: svn://10.0.0.236/trunk@9300 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-04 00:47:22 +00:00
norris%netscape.com
bc2d3f5307 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.


git-svn-id: svn://10.0.0.236/trunk@9296 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-04 00:45:21 +00:00
rogerl%netscape.com
9f90098dfb Removed redundant #undef
git-svn-id: svn://10.0.0.236/trunk@9269 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 22:50:55 +00:00
rogerl%netscape.com
5bc4554a6e 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.


git-svn-id: svn://10.0.0.236/trunk@9233 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 20:44:55 +00:00
rogerl%netscape.com
1400e8fb8b New errorNumber handling
git-svn-id: svn://10.0.0.236/trunk@9232 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 20:35:41 +00:00
rogerl%netscape.com
f039948f09 New break-out of error message text from core engine
git-svn-id: svn://10.0.0.236/trunk@9231 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 20:33:32 +00:00
rogerl%netscape.com
112983b87d New errorNumber handling
git-svn-id: svn://10.0.0.236/trunk@9230 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 20:29:37 +00:00
mccabe%netscape.com
c918d7df77 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.


git-svn-id: svn://10.0.0.236/trunk@9145 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-02 20:01:34 +00:00
mccabe%netscape.com
09183e892f 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.


git-svn-id: svn://10.0.0.236/trunk@9105 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-02 08:19:31 +00:00
bjorn%netscape.com
7b045fdab6 Added compare-and-swap patches for AIX (_check_lock) and Solaris (stbar).
git-svn-id: svn://10.0.0.236/trunk@9021 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 20:21:11 +00:00
shaver%netscape.com
00bff720d0 if throwing, cx->exception is a valid root
git-svn-id: svn://10.0.0.236/trunk@8969 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 12:38:59 +00:00
mccabe%netscape.com
cead6ec411 restore npl.
git-svn-id: svn://10.0.0.236/trunk@8932 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 01:16:45 +00:00
mccabe%netscape.com
f3c665324e 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.


git-svn-id: svn://10.0.0.236/trunk@8931 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 01:15:16 +00:00
mccabe%netscape.com
a7b8207a95 Further runtime error work... expose many new errors as catchable
exceptions.  Mostly syntax errors, so far.  Fixed missing #if
JS_HAS_ERROR_EXCEPTIONS


git-svn-id: svn://10.0.0.236/trunk@8856 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-31 09:49:43 +00:00
mccabe%netscape.com
1cf03b53f5 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...


git-svn-id: svn://10.0.0.236/trunk@8855 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-31 08:17:40 +00:00
mccabe%netscape.com
d4a8ee886c Added jsmsg.def to the list of files used by the
'make tar' target.


git-svn-id: svn://10.0.0.236/trunk@8854 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-31 07:33:13 +00:00
mccabe%netscape.com
e02c67ff07 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.


git-svn-id: svn://10.0.0.236/trunk@8853 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-31 07:07:26 +00:00
fur%netscape.com
1ab259806c Shane's makefiles
git-svn-id: svn://10.0.0.236/trunk@8792 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 03:04:11 +00:00
fur%netscape.com
65bdc27683 New file to deal with case of Java field and method with same name.
git-svn-id: svn://10.0.0.236/trunk@8791 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 03:03:51 +00:00
fur%netscape.com
8a8bb3d77e Error messages, in separate file for internationalization purposes.
git-svn-id: svn://10.0.0.236/trunk@8790 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 03:03:05 +00:00
fur%netscape.com
4eb3df0d29 Transferred work from private ns tree back into mozilla.
git-svn-id: svn://10.0.0.236/trunk@8789 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 03:00:50 +00:00
fur%netscape.com
c3bc213bef Somehow, montulli resurrected this dead file. Killing it again.
git-svn-id: svn://10.0.0.236/trunk@8786 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 02:47:25 +00:00
fur%netscape.com
8d0f6d433f Updated Mac build instructions.
git-svn-id: svn://10.0.0.236/trunk@8781 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 02:20:24 +00:00
fur%netscape.com
5ac9b15456 Replaced with new CodeWarrior project file macbuild/JSRef.mcp
git-svn-id: svn://10.0.0.236/trunk@8780 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 02:20:00 +00:00
mccabe%netscape.com
2ae960ccbd More loose ends towards merging the development branch.
git-svn-id: svn://10.0.0.236/trunk@8779 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 01:53:39 +00:00
mccabe%netscape.com
eb64550ea4 New platforms! More work from development branch.
git-svn-id: svn://10.0.0.236/trunk@8771 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 00:40:07 +00:00
mccabe%netscape.com
ac4f37b0a5 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.


git-svn-id: svn://10.0.0.236/trunk@8770 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 00:38:43 +00:00
brendan%netscape.com
541a9954be Fix funky whitespace.
git-svn-id: svn://10.0.0.236/trunk@8591 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-27 01:48:25 +00:00
shaver%netscape.com
9013b35743 JS_ConstructObject: fill NULL proto/parent like JSOP_NEW would
git-svn-id: svn://10.0.0.236/trunk@8495 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-26 06:14:55 +00:00
brendan%netscape.com
71e7443c33 Fix typos, white-space, and layout style nits.
git-svn-id: svn://10.0.0.236/trunk@8437 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-25 08:22:27 +00:00
brendan%netscape.com
6d7164c0d9 Propagate js/src back-out of fur's incompatible closure version-check mod.
git-svn-id: svn://10.0.0.236/trunk@8436 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-25 08:21:55 +00:00
brendan%netscape.com
9e306d15ea Propagate warren's OJI-related XP_MAC pragma change from js/src.
git-svn-id: svn://10.0.0.236/trunk@8435 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-25 08:21:09 +00:00
brendan%netscape.com
7d61af5201 Fix nits.
git-svn-id: svn://10.0.0.236/trunk@8434 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-25 07:56:42 +00:00
cls%seawood.org
4288391d23 AUTOCONF_1_0 landing.
git-svn-id: svn://10.0.0.236/trunk@8198 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-19 20:42:14 +00:00
mccabe%netscape.com
6b768767e5 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.


git-svn-id: svn://10.0.0.236/trunk@7884 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 22:09:21 +00:00
mccabe%netscape.com
0124b1e0d6 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.


git-svn-id: svn://10.0.0.236/trunk@7854 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-12 19:45:04 +00:00
shaver%netscape.com
e450ec31e8 added JSVersion JSVERSION_1_4
git-svn-id: svn://10.0.0.236/trunk@7061 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-01 19:43:23 +00:00
mccabe%netscape.com
5dce40da3b 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.


git-svn-id: svn://10.0.0.236/trunk@6905 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-30 23:46:29 +00:00
mccabe%netscape.com
b289a7e9f5 Added NPL.
git-svn-id: svn://10.0.0.236/trunk@6904 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-30 23:44:39 +00:00
mccabe%netscape.com
171803661a 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.


git-svn-id: svn://10.0.0.236/trunk@6445 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-24 23:12:09 +00:00
mccabe%netscape.com
2320e36eef added some more #if JS_HAS_SHARP_VARS checks so towards compiliation
under version 120 in jsconfig.h.  Other fixes needed, though...


git-svn-id: svn://10.0.0.236/trunk@5848 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-17 21:18:41 +00:00
mccabe%netscape.com
005974ff02 Fixed #ifdef to #if for various features defined in jsconfig.h -
JS_HAS_IN_OPERATOR, and JS_HAS_INITIALIZERS.


git-svn-id: svn://10.0.0.236/trunk@5839 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-17 20:46:12 +00:00
mccabe%netscape.com
beb8b2b683 Fixed interpretation of JSOP_IN to match our ECMA proposal - throw a
runtime error if the RHS is not an object.


git-svn-id: svn://10.0.0.236/trunk@5830 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-17 19:10:46 +00:00
mccabe%netscape.com
24714d3ec7 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.


git-svn-id: svn://10.0.0.236/trunk@5784 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-17 02:56:04 +00:00
mccabe
b00377b8ce Added configuration section for js 1.4, with in/instanceof/exceptions turned
on.  (Default configuration is still 1.3.)


git-svn-id: svn://10.0.0.236/trunk@5567 18797224-902f-48f8-a5cc-f745e15eee43
1998-07-15 03:00:24 +00:00