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

389 Коммитов

Автор SHA1 Сообщение Дата
rogerl%netscape.com 1b01852975 r=brendan@mozilla.org
Bug #14462, lot's of discussin there about these changes, but here's
Brendan's description :
In order, changes in the patch are:

- Rename JSSLOT_ITR_STATE to be JSSLOT_ITER_STATE (avoid cybercrud abbreviation
as cbrcrd, no more six-char id limits!).

- Property cache tests must occur with the object's scope-lock held, to close a
race with delete (js_DestroyProperty, always called with the property's scope
locked).  Once the cache has been hit, and before the lock is released, the
property's refcount must be bumped.  This requires re-acquisition of the lock
and js_DropScopeProperty afterward.

- Reworked js_FindProperty to use a do-while loop, as cx->fp->scopeChain must be
non-null.  This avoids a gratuitous lastobj init done to "Suppress gcc warning"
in the old revision.

- Akin to the property cache hit cases in jsinterp.c and jsobj.c's
js_FindProperty, code to hold and drop the scope-property by its refcount that
was #ifdef JS_THREADSAFE must be unconditional, now that user-defined getters
and setters may delete the property id they're getting or setting.

- Fixed overlong continuation line in jsobj.h.

/be
2000-02-08 01:24:53 +00:00
brendan%mozilla.org 1462b9a294 - Eliminate ancient, bogus proxying of function object for its call objects (23346, r=jband@netscape.com).
- Tabs expanded as much as I could stand, without taking too much cvsblame.
2000-02-04 02:01:49 +00:00
mccabe%netscape.com e2e7c63c10 Changes to allow Spider Monkey to be compiled under C++.
Courtesy Bill Gibbons <bill@gibbons.org>

His comments:

Here are the changes to JSRef to make it compile either as C or C++. Mostly the changes are to add missing casts (since C++ doesn't have implict conversion from void* to other pointer types nor implicit casts from ints to enumerations) plus a few random things like the use of "private" as a variable name.

There are a few other minor bug fixes; in particular:

  * A long statement with and'ed conditions is reformatted to make it easier to remove other builtin objects (e.g. Date).

  * A #if was added to jsscript.c for the JS_HAS_SCRIPT_OBJECT off case.

  * In jsmath a #ifdef was changed to #if.

My notes also mention...

  * jsobj.c should include jsopcode.h

  * jsfun.c - doesn't link if JS_HAS_ARGS_OBJECT is off

  * jsarray.c - a reference to js_ValueToSource should be conditional on JS_HAS_TOSOURCE

r=mccabe
2000-02-02 01:10:31 +00:00
norris%netscape.com c04c4d51f9 Fix bug #25864 watch() vulnerability
r=vidur,rogerl
2000-02-02 00:22:58 +00:00
brendan%mozilla.org db78bfb8b1 JS1.5 fixes (17290, 21618, plus shaver's 22243 fix, r=shaver@mozilla.org). 2000-01-18 11:06:05 +00:00
brendan%mozilla.org 46665376d1 Fix obscure eval bug and ECMA conformance issue (20256, r=rginda@netscape.com). 1999-12-01 04:30:04 +00:00
brendan%mozilla.org 92490cbc03 Whitespace, comment, and bracing diffs. 1999-11-17 04:32:37 +00:00
rogerl%netscape.com 3118263222 r=norris
Fix for toString under 1.2 - calls toSource which provides extra '{}' that
doesn't match previous behaviour.
1999-11-16 23:53:33 +00:00
brendan%mozilla.org 367ea33053 XULDOMJS_19991106_BRANCH landing (15146, 18025, r=shaver@mozilla.org) 1999-11-12 06:03:40 +00:00
mccabe%netscape.com 5b9d75022d Fix most remaining warnings in js/src. Patch courtesy slamm.
r=mccabe.
1999-11-11 21:52:35 +00:00
brendan%mozilla.org 9d476409b6 Fixed getter/setters, pave way for brutal sharing (15146, r=shaver@mozilla.org,rogerl@netscape.com) 1999-11-02 02:23:50 +00:00
brendan%mozilla.org 526bfd1116 - Chouck's changes to grow a JSIdArray if necessary in JS_Enumerate, with my
code review and fixes (r=chouck@geocast.com).  He needs this cuz he has no
  knowledge of exact number of properties before new-style enumerating them.
- Patch up jsdbgapi.c a bit -- it needs to use OBJ_GET_ATTRIBUTES and new APIs
  to do a better job describing properties to a debugger.
- Add JSMSG_CANT_DESCRIBE_PROPS for bogus non-native error case in jsdbgapi.c.
- Fix "Inappropriate" => "invalid" in JSMSG_BAD_ARRAY_LENGTH message.
1999-10-25 19:24:03 +00:00
brendan%mozilla.org f1534c54ea Avoid gratuitous initialization and extra sets of ok (r=shaver@mozilla.org). 1999-10-22 01:44:47 +00:00
shaver%netscape.com 34010403ff fix obj_getCount to property destroy state and propagate error (r=jband) 1999-10-15 04:32:46 +00:00
norris%netscape.com 8a23341b00 Fix unix build warning.
Reviewed by rogerl@netscape.com.
1999-10-12 22:48:17 +00:00
brendan%mozilla.org 78daa5976c Fix Object.prototype.toSource so it parenthesizes outermost-toSource literals for eval roundtrips. 1999-10-06 09:09:31 +00:00
norris%netscape.com d21c5596fd Fix the following bugs:
14443 "Same origin" security policy may be circumvented using docu
14820 Fixing up the relationship between nsCodeBasePrincipal and n
14919 Crash in JS MM code
Reviewed by mstoltz, approved by scc.
1999-10-02 03:41:37 +00:00
dmose%mozilla.org 16e0d1f95e update license boilerplate to NPL-1.1 dual-licensed with the GPL. a=brendan, r=brendan. 1999-09-28 23:12:09 +00:00
brendan%mozilla.org d70aa0ef6b - Enable JS_HAS_NEW_OBJ_METHODS (Object.prototype.hasOwnProperty, isPrototypeOf
and propertyIsEnumerable) for JS1.5.
- Optimize obj_propertyIsEnumerable to avoid extra lookup code bloat, requiring
  fix to js_GetAttributes (unset out param on successful early retunr) that it
  exposed.
- Use more righteous else-if style in shaver's jsarray.c change.
1999-09-22 05:54:44 +00:00
brendan%mozilla.org 94a86fe442 - Bumped default compile-time JS version from 1.4 to 1.5.
- Add JS1.5 getter/setter support in all its glory:

  * getter function SN() {return ++x} at top-level or as a closure binds an SN
    property getter than returns the incremented value of x.  Likewise for
    setter function SN(y) {return y = x}.

  * getters and setters may be defined in an object literal:
      o = {p getter:function() {return ++this.x},
           p setter:function(y){return this.x = y},
           x:42};

  * getter= and setter= operators (compound tokens) may be used to bind getter
    and setter properties dynamically:
      o = new Object;
      o.p getter= function() {return ++this.x};
      o.p setter= function(y){return this.x = y};
      o.x = 42;

    Waldemar is concerned that this form will collide semantically with JS2, so
    I am not committing to keeping it in JS1.5.  I'd like to check my code in
    ASAP so shaver can use it, and I'd also like to see this form get used (or
    not) during Mozilla betas.  Caveat emptor, and if you find this "dynamic"
    or "imperative" form necessary and hard to substitute, please let me know.
    If this proves important to users, then I think JS1.5 should keep it.

- Cleaned up property flags (in a binary-incompatible fashion -- who cares?) by
  eliminating JSPROP_ASSIGNHACK and JSPROP_TINYIDHACK.

- Added JS_DONT_PRETTY_PRINT flag to be ORed with the indent argument to the
  several JS_Decompile*() API calls.  This avoids any newlines or identation in
  the decompiled string.
 
- Improved and extended (for getter/setter non-reservation) scanner lookahead
  by using a circular (power-of-2 sized) token buffer.

- Fix ECMA Edition 3 deviation where function f(){function g(){}} bound f.g by
  mistake (it should arrange to make a closure named g in activations of f, but
  it should not bind a property of function f).
1999-09-21 00:13:48 +00:00
jband%netscape.com 83ffb3a7d0 check resolve op for null before trying to use it 1999-09-11 05:22:42 +00:00
brade%netscape.com d2b75277c5 remove mac compiler warnings 1999-08-20 13:30:39 +00:00
brendan%mozilla.org ed627432e2 Fix warnings reported at http://tinderbox.mozilla.org/SeaMonkey/warnings.html, mostly unsigned/signed bothers. 1999-07-28 06:48:44 +00:00
brendan%mozilla.org 3f05c43fc5 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
brendan%mozilla.org 7fa05e97d9 - Fix for..in bug where ECMA 12.6.3 steps 5 and 6 are reversed: the effect was
to define an unbound global variable used to enumerate an empty object, when
  the standard says no variable should be defined.
- Clean up minor nits, make comment style match prevailing, tighten up for..in
  element-indexing special case comments.
- Fix js_Invoke to take CONSTRUCT and INTERNAL flags arg instead of a construct
  boolean arg and the JSStackFrame internalCall mis-located boolean non-arg.
  Use these flags correctly in all calls (previous version failed to set the
  bogus frame.internalCall around js_Invoke calls from jsfun.c and jsstr.c).
1999-07-15 02:24:23 +00:00
brendan%mozilla.org 1eed515ae6 Rip out assign hack, simplify boolean value synthesis, minor cleanups. 1999-07-01 02:24:32 +00:00
brendan%netscape.com 54eafda12a - Rename js_CallFunctionValue to js_InternalCall to distinguish it from all
"external" calls compiled from scripts, which have stack budget depth slots
  under the return value slot for the call expression's generating pc.
- New internalCall packed boolean flag in JSStackFrame to distinguish callers
  of js_InternalCall so the generating pc isn't mistakenly stored depth slots
  below stack space allocated on-the-fly for internal call args/rval.
- Fixed bugzilla bug 8042, finally by storing the call expression's generating
  pc -- but only for external calls.
- Whitespace policing, gratuitous parenthesization reduction, etc.
1999-06-26 03:28:47 +00:00
rogerl%netscape.com 5f9a2314ee Fixed bug #7635. instanceof now starts the chain walk from the object
prototype.
1999-06-15 23:44:30 +00:00
fur%netscape.com 543e6e7fe4 Merge changes from SpiderMonkey140_BRANCH. Note: none of the
added files participate in the client build.
1999-04-27 15:18:57 +00:00
brendan%netscape.com d46bbcad44 Cast printf %p args to (void*). 1999-04-27 03:42:28 +00:00
jband%netscape.com 2e68a1089d js_DefaultValue now accepts that it is OK for a request with hint of JSTYPE_OBJECT to result in an object of type JSTYPE_FUNCTION. This is done so that objects that happen to have 'call' ops will not fail when being 'converted' to 'Object'. This Fix is going onto the trunk, SpiderMonkeyDev_BRANCH, and SpiderMonkey140_BRANCH 1999-04-02 23:16:40 +00:00
mccabe%netscape.com 7949df7b77 Stable drop of JavaScript interpreter code from SpiderMonkey140_BRANCH 1998-11-05 00:08:43 +00:00
fur%netscape.com 7b75221d8c Checkpoint JS1.4 from JS_STABLE_10131998_BRANCH. Changes include:
+ merging of js/src and js/ref
 + elimination of most dependencies on NSPR
 + JS1.4 feature additions and accumulated bug fixes

More details are in last week's mozilla status report.
1998-10-14 10:22:38 +00:00
shaver%netscape.com 52c57fa8ce JS_ConstructObject: fill NULL proto/parent like JSOP_NEW would 1998-08-26 06:14:55 +00:00
warren%netscape.com c9bd5d8074 Landing changes in the OJI_19980727_BRANCH since the OJI_19980727_TIP_MERGE tag. 1998-07-31 20:19:50 +00:00
mccabe%netscape.com 0ed94e2af6 Propagating numerous fixes from js/ref
and development branches, including but
not limited to:

- 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-31 00:07:22 +00:00
fur b8940b6cb4 Propagation of numerous bug fixes from 4.06 (which have been reviewed
and tested in that release):

#114564: Fix JS_Enumerate to return an empty id array instead of null
#115395: Fix JS garbage collection
#115200: Security dialog no longer blows assertion
#123211: Make sure output of sort array function is -1, 0, or 1.
#116195: Fix ImportProperty(), cope with an existing local variable
         of the same name as the imported property
         Unbusticate JS_invoke() so that closures work again
#115384,#115395: Handle bugs in toSource that strike when
         getProperty is non-idempotent.  Fix crash during JavaScript
         garbage collection after enumerating object properties.

#??????: mjudge - Win16 files to make ptrdiff_t be 32 bits on Win16
1998-06-09 23:04:48 +00:00
fur ddc67e87cf Initial checkin of JavaScript 1.3, migrated from JSFUN13_BRANCH in /m/src repository 1998-04-24 00:31:11 +00:00
ltabb 3b56a9af51 Free the lizard 1998-03-28 02:44:41 +00:00