Closed Bug 297247 Opened 20 years ago Closed 20 years ago

want ability to pass script in chunks to the js engine

Categories

(Core :: JavaScript Engine, enhancement, P5)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 274651
Future

People

(Reporter: Biesinger, Unassigned)

Details

a possible enhancement to nsScriptLoader (convert to nsIUnicharInputStream, to
avoid manual charset conversion) would like the ability to pass data in chunks
to the javascript engine.

I believe the current APIs do not allow that, as they might incorrectly compile
code like:
var foo = 42
+ 4711

If a buffer boundary is between the two lines.

The code can tell the JS engine which chunk is the last (or more convenient
would be if it told the JS engine that the previous chunk would be last, actually)

So, such a function would be nice. I'm not familiar enough with JS API to
suggest naming/syntax.
Given the current recursive descent front end in js/src/jsparse.c, this requires
running the JS engine, or at least the compiler, in a coroutine, fiber, or
similar such lightweight thread.  The parser's state is smeared across arbitrary
C stack frames, so deciding an API naming is the last detail.

This should await a larger rearchitecture step to move toward JS2 (which still
needs definition).

/be
Priority: -- → P5
Target Milestone: --- → Future
dup of bug 274651 ?
hm, yes. I must've forgotten about that bug...

*** This bug has been marked as a duplicate of 274651 ***
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.