Canny | 3 Jul 16:47

JSAtom

Hi,

I am wondering what the type JSAtom represents? It seems to me that
its definition is even not appearing in firefox code base. The closest
thing I found is the following typedef declaration:

typedef struct JSAtom               JSAtom;

I appreciate your help!

Thanks,
Canny
Yan Huang | 3 Jul 15:34

JSAtom

Hi,

I am wondering what the type JSAtom represents? It seems to me that its
definition is even not appearing in firefox code base. The closest thing I
found is the following typedef declaration:

typedef struct JSAtom <http://mxr.mozilla.org/firefox/ident?i=JSAtom>
             JSAtom <http://mxr.mozilla.org/firefox/ident?i=JSAtom>;

I appreciate your help!

Thanks,
Canny
Canny | 2 Jul 22:30

semantics of some JSOPs


I am quite confused about the meaning of the following JS operations.

OPDEF(JSOP_CALLNAME,  57, "callname",   NULL,         3,  0,  2, 19,
JOF_ATOM|JOF_NAME|JOF_CALLOP)
OPDEF(JSOP_NAME,      59, "name",       NULL,         3,  0,  1, 19,
JOF_ATOM|JOF_NAME)
OPDEF(JSOP_BINDNAME,  108,"bindname",   NULL,         3,  0,  1,  0,
JOF_ATOM|JOF_NAME|JOF_SET)
OPDEF(JSOP_SETNAME,   109,"setname",    NULL,         3,  2,  1,  3,
JOF_ATOM|JOF_NAME|JOF_SET|JOF_DETECTING)

It seems that they are somehow related to each other. But I can't
guess too much information about these bytecode operations from
disassembling toy code written myself.

I would appreciate if anyone can give the definitions of these
operations.

Thanks!

-- Canny
philippe | 2 Jul 11:42

XmlHttpREquest

Hi

I made  a chrome over gecko

I trace the states of my Http(s) and Files requests using OnStaeChange
and onLocationChange.

Now I start with Ajax XmlHttpRequest.

If I use the following code into a javascript function

		function getSynchronousContentByAjax(url) {

			httpRequest = new XMLHttpRequest();
			httpRequest.open('GET', url, false);
			httpRequest.send(null);

			return httpRequest.responseText;
		}

It works OK and I can replace the text into a div by the text got from
the URL.

But I have no trace about the call to the URL , no trace from
onStateCHange or from onLocationCHange

I saw that there is an interface nsIXmlHttpREquest. Have I to use it ?

Do you have samples

(Continue reading)

Boris Zbarsky | 2 Jul 00:40
Favicon

Re: explanation about javascript bytecode opcodes

Canny wrote:
> While studying the JavaScript engine source code used in Firefox, I am
> confused about the semantics of various JS bytecode operations given
> in jsopcode.tbl file (http://mxr.mozilla.org/firefox/source/js/src/
> jsopcode.tbl). Is there anyone can provide some pointers to more
> detailed explanation about those operations?

Sending on to the right newsgroup...

-Boris
adrian.ardi | 1 Jul 21:04
Favicon

Respuesta automática

Hello ,
We are wholesale and retail business for electronic products and now we are looking for partners to sell our products . our price is lowest and quality is excellent .
Our business scape is electronic products, mobilephone , laptop MP3/4 ,PSP ,PS3 ,GPS,LCD TV ,DVD ,camera ,Motorcycle and so on . the price is very good and quality is excelent . you can buy for your end use or sale . our contact information as below :
WEB:www.ebuymz.com
E-mail: ebuymz <at> ebuymz.com
MSN : ebuymz <at> hotmail.com
Phone : +008615210371799
If there is disturb please pardon.

_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine <at> lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Graydon Hoare | 1 Jul 03:38
Favicon

Keeping Mozilla and Adobe nanojit versions in sync.

Hi,

This is a long email. Sorry, it needs to be a bit long.

Background.
-----------

Some of you may be aware, if you've been following nanojit development,
that Adobe and Mozilla are diverged. There are two copies of nanojit
embedded in independently-evolving repository histories: the Tamarin
history and the Tracemonkey history.

This is a historical accident, not a matter of policy. We had every
intention to be doing high-frequency / fine-granularity merges, simply a
lack of knowhow about how to do so *easily* and a lack of time to pursue
the correct technique. We've been trading high-priority patches for the
past nine months manually, and gradually diverging on other matters.

We have enough time now to pay attention to the issue again and try to
get it right. Previously -- as long ago as last year -- Edwin and I
tried forming a nanojit-only history with two repositories: one for
Adobe and one for Mozilla. Our hope, at the time, was that these two
repositories would hold tip revisions that were identical to the nanojit
subdirectories embedded in the Tamarin and Tracemonkey repositories,
respectively. We failed in that attempt for two reasons:

     1. We did not start from merged repositories, but were playing
     catch-up with the ongoing development in both Tamarin and
     Tracemonkey repositories.

     2. We were manually transporting patches and applying them by hand
     or munging them via handmade scripts from one repository to another.

These two factors made it too awkward to regularly merge and we quickly
fell behind. I'm hoping we can find a way around these failure modes
presently, and have spent a little while hunting around for
alternatives. I think I have a way to do it, but it requires a little
discussion and a fair amount of buy-in from the development groups
involved. And thankfully, nobody else.

Proposal.
---------

I'm proposing we pick a flag day both the Tamarin team and the
Tracemonkey team can agree on and simultaneously do the following:

     1. Merge. Really really merge. Get everyone on the same IRC channel,
     stop feature work, and set about resolving (with bug references,
     regression testing and discussion) every remaining difference
     between the two repositories, until we're identical. There is, as
     far as I know, no fundamental disagreement on technical choices
     between the teams, just a bunch of drift.

     2. Re-seed the nanojit-only history Edwin and I attempted before,
     but starting with this merged state.

     3. Using 'hg convert', along with a splicemap and a filemap, splice
     the nanojit-only history onto the merged (therefore identical) tips
     of both the Tracemonkey and Tamarin repositories.

     4. Add incoming hooks to the Tracemonkey and Tamarin repositories
     (and local precommit hooks to all the local developer machines on
     each team) *prohibiting* local checkins to the nanojit/
     subdirectory. All changes to nanojit henceforth get made on the
     nanojit-only history and copied to the Tracemonkey and Tamarin
     repositories with 'hg convert'.

I've tested this sort of setup, and it can be made to work. It's not
even terribly hard. You wind up with a splicemap file like:

     <0th-revision-in-nanojit> <splicepoint-revision-in-Tracemonkey>

and a filemap file like:

     rename . js/src/nanojit

and you wind up making day-to-day nanojit changes like so:

     ~/src/nanojit-only$ hg commit --message="Some nanojit bug."
     ...
     ~/src/nanojit-only$ cd ..
     ~/src$ hg convert \
               --source-type=hg --dest-type=hg \
               --filemap=filemap --splicemap=splicemap \
               --config convert.hg.saverev=True \
               nanojit-only tracemonkey
     ...
     ~/src$ cd tracemonkey/js/src/obj
     ~/src/tracemonkey/js/src/obj$ hg up
     ...
     ~/src/tracemonkey/js/src/obj$ make check
     ...
     ~/src/tracemonkey/js/src/obj$ hg push

(Replace Tracemonkey-specific paths with Tamarin paths in Tamarin's
  case)

I'll grant, this is not *totally* simple, but it's simple enough that it
can be internalized and hooked to reject incorrect actions. And
nobody outside our two development groups needs to care that this is
happening; it doesn't require any new machinery.

Alternatives.
-------------

Every alternative I looked at involves adding repository metadata or
non-hg tools, which means convincing *all* hg users in the Adobe and
Mozilla development communities to install new code and learn to use it,
just to carry on doing what they're doing today. This is a steep cost I
wanted to avoid. The proposal above only affects a handful of
people. I'm happy to be pointed to more that this isn't true for. I just
discovered that 'convert' does splicing, file-renaming and hg-to-hg
operation recently. Those are the important bits you need to automate
the patch-flow.

Open questions.
---------------

     1. Does the above proposal make sense, seem reasonable, suit
     everyone's preferences, etc. etc.? Do you hate it? Can you think of
     any general ways to improve it?

     2. The 'hg convert' command does keep a mapping file associating
     imported and local revision IDs. It may make more sense to check
     this file in and commit it after each import, such that we all work
     from the same associations; or it may make more sense to keep a
     local copy of it elsewhere. I'm not sure. I believe it can be
     reconstructed relatively easily in any case (particularly if
     original-revision IDs get projected into the synthesized revisions,
     as in my example). Any thoughts?

     3. The proposal above involves sticking with *two* nanojit-only
     repositories. This still permits the two repositories (within the
     shared nanojit-only history) to diverge, and requires periodic pulls
     from one to the other to absorb one another's work. And it will
     necessarily involve a history with two evolving heads, two
     "lineages". Would it makes more sense to try having only *one*
     nanojit-only repository, that we insist remains functional for
     *both* embeddings, both Tracemonkey and Tamarin?

     4. If it's agreeable, what's a good flag-day to do it on?

Thanks for the read. Any further thoughts you have on the matter would
be great. Crossposting this to tamarin-devel and
mozilla.dev.tech.js-engine.

-Graydon
philippe | 25 Jun 11:44

Syncronization problem with JS_DefineFunctions

Hi

I made a chrome over mozilla .

I use JS_DefineFunctions to déclare functions callable from pages.

Each Time I receive  STATE_STOP and STATE_IS_REQUEST, I call
JS_DefineFunctions.

It works OK.

But now our customers use our browser and in <body use onload="JS_F"

where JS_F is a JS function calling some of the functions defined with
JS_DEFINE_FUNCTIONS

It works, but from time to time, a so called function defined in
JS_DEFINED_FUNCTION is not found.(Maybe it is not loaded at this
moment).

The questions I have are the followings

- Where is the good time to call the JS_DEFINE FUNCTIONS
- Is it possible to be informed that the onload starts.
(Observer .....)
- Is it possible to know if the JS_DEFINE_FUNCTION's completion is OK.

thank's for your response

philippe
Brendan Eich | 23 Jun 22:00
Favicon

Re: Help needed in grokking property getter idval arg (for native array wrapping).

On Jun 23, 6:09 am, "Spriggs, Jim" <J.Spri...@raylase.de> wrote:
>     JSObject* arrObj = JS_NewArrayObject(cx, 0, NULL);

Why are you making a standard Array object if you want a custom array-
like object? You should make your own object with its own JSClass.
That JSClass would have GetArrayElement as its getProperty function.

>         // define arr property with explicit getter
>     JS_DefineProperty(cx, global, "arr", OBJECT_TO_JSVAL(arrObj), GetArrayElement, NULL,
JSPROP_SHARED | JSPROP_READONLY);

You defined a global property named "arr" with a custom getter invoked
to compute the value of that property. Not to compute values of index
properties in arrObj.

/be
Spriggs, Jim | 23 Jun 15:05
Favicon

Help needed in grokking property getter idval arg (for native array wrapping).

Hi Guys,

Goal
----
In my embedding of Spidermonkey 1.7, I'm trying to wrap a simple native array 
which is (ultimately) declared similarly to this:

	double nativeArray[256];

What I've coded so far:
-----------------------

// the property getter
JSBool GetArrayElement(JSContext* cx, JSObject* obj, jsval idval, jsval* rval) 
{
	int32 index = 0;
	JS_ValueToInt32( cx, idval, &index );

	return rvalFromDouble(cx, GetNativeArrayElement(index), rval);
}

main(...)
{

	// initialisation blah - Runtime, Context, etc

    JSObject* arrObj = JS_NewArrayObject(cx, 0, NULL);

	// define arr property with explicit getter
    JS_DefineProperty(cx, global, "arr", OBJECT_TO_JSVAL(arrObj), GetArrayElement, NULL,
JSPROP_SHARED | JSPROP_READONLY);

	// etc 
	// then drop into read/execute/print loop

}

Test Script:
------------

	var e = arr[7];

Expected result:
----------------

On entering GetArrayElement(...):
	
	JSVAL_IS_INT(idval) == true
and
	JSVAL_TO_INT(idval) == 7

In other words, id would actually represent the index of the required element ( 7, in this case), even if it
doesn't yet exist.

Actual result:
--------------

On entering GetArrayElement(...):

	JSVAL_IS_STRING(idval) == true
and
    	JS_GetStringBytes(JSVAL_TO_STRING(idval)) == "arr"

i.e., apparently unrelated to the index given in the script.

Source of information:
----------------------
JSAPI Reference: JSPropertyOp:

"idval 	jsval 	The name or index of the property being accessed. This is either a string (Unicode property
identifier) or an integer (element index)."

What am I missing?

Thanks!
--

-- 
Jim Spriggs
Senior Software Engineer
Ext./Durchwahl 25
alerma | 23 Jun 13:39

Marking and tracking variables

Hello,

I am working on a project where we need to mark some sensitive
information in JavaScript and track these markers through various
operations, like assignments, concatenations, etc.

Consider the following example:

var a = 'a';
var b = new String('b');
b.marker = 1;
var c = 'c';
var d = a + b + c;

Is it possible to pass the marker through concatenation and
assignment
op so that it will appear at variable d? As far as I know there is no
way to overload + operator in JavaScript? Is it correct?
Is there any possible way to do it without modifying SpideMonkey's
source code?

Thanks,
Alex

Gmane