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

26 Коммитов

Автор SHA1 Сообщение Дата
rogerl%netscape.com 1beeb9a9fa r=norris
Fixed bug #12951 - var if for..in statement should always be of type
string.
1999-10-19 21:06:03 +00:00
brendan%mozilla.org bb6510becd Fix two multi-threaded GC-rooting bugs:
- js_NewFunction wasn't initializing (clearing) JSFunction members before it
  linked the JSFunction to a JSObject that the GC could reach from a root.
- Make sure frame.scopeChain is cleared before linking frame via cx->fp, even
  though we set frame.scopeChain to some object later (another signal that we
  should rework js_Invoke to inline it and otherwise optimize it).
1999-10-06 06:29:43 +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
shaver%netscape.com 8d0545f569 properly unlock object, preventing ugly crash with |if (foo in noFoo)| 1999-09-27 06:04:54 +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
rogerl%netscape.com 8ee7e4dbe3 Fixed bug : 8672, using prototype from closure instead of function
Fixed memory leak- object acquired by 'in' operator was not being released.
1999-08-30 22:17:55 +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 23eab7fbcf Warning abatement. 1999-07-15 02:46:00 +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%netscape.com fe9bf84815 Final part of 8042 fix: always initialize frame.internalCall. 1999-06-29 00:22:06 +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
fur%netscape.com dbef917c04 Removing shaver/brendan fix for #8042 since it's apparently buggy 1999-06-23 19:39:08 +00:00
fur%netscape.com 51498f2fa6 Merge from SpiderMonkey140_BRANCH:
Incorporated changes from JS_STABLE_DROP_04261999 to JS_STABLE_DROP_06221999
1999-06-23 14:18:56 +00:00
jband%netscape.com 58fa7ac41c fix for bug 7698. Have the prop state object call the right object when doing the JSENUMERATE_DESTROY and make sure that the object does not get gc'd first 1999-06-11 19:16:46 +00:00
jband%netscape.com 80bc0d7d43 make js_AllocStack, js_FreeStack, and js_Invoke, FRIEND functions so that they can be used by our good friend xpconnect. 1999-06-03 21:39:08 +00:00
shaver%netscape.com 75836d64c2 fix CHECK_BRANCH fencepost 1999-05-14 23:53:33 +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
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
brendan%netscape.com 3d80897294 Fix typos, int type mismatch, white-space, and layout style nits. 1998-08-25 08:23:34 +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
mccabe e50bbd58f4 Added a few (JSOp) casts to appease Macintosh compiler workings.
Enums are types!
1998-06-04 00:22:55 +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