Allow to compile and run SM when !JS_HAS_GENERATORS. bug=347065 r=brendan

This commit is contained in:
igor.bukanov%gmail.com 2006-09-20 14:50:43 +00:00
Родитель 66a2be047c
Коммит bb6551c9b1
2 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -6097,7 +6097,6 @@ interrupt:
#undef FAST_LOCAL_INCREMENT_OP
#if JS_HAS_GENERATORS
BEGIN_CASE(JSOP_STARTITER)
/*
* Start of a for-in or for-each-in loop: push two nulls. Push
@ -6130,6 +6129,7 @@ interrupt:
sp -= 3;
END_CASE(JSOP_ENDITER)
#if JS_HAS_GENERATORS
BEGIN_CASE(JSOP_GENERATOR)
pc += JSOP_GENERATOR_LENGTH;
SAVE_SP_AND_PC(fp);
@ -6187,8 +6187,6 @@ interrupt:
#endif /* JS_HAS_GENERATORS */
#if !JS_HAS_GENERATORS
L_JSOP_STARTITER:
L_JSOP_ENDITER:
L_JSOP_GENERATOR:
L_JSOP_YIELD:
L_JSOP_ARRAYPUSH:

Просмотреть файл

@ -121,8 +121,6 @@ JSClass js_IteratorClass = {
JSCLASS_NO_OPTIONAL_MEMBERS
};
#if JS_HAS_GENERATORS
static JSBool
Iterator(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
@ -285,8 +283,6 @@ static JSFunctionSpec iterator_methods[] = {
{0,0,0,0,0}
};
#endif /* JS_HAS_GENERATORS */
JSBool
js_NewNativeIterator(JSContext *cx, JSObject *obj, uintN flags, jsval *vp)
{
@ -958,14 +954,14 @@ js_InitIteratorClasses(JSContext *cx, JSObject *obj)
if (stop)
return stop;
#if JS_HAS_GENERATORS
/* Expose Iterator and initialize the generator internals if configured. */
proto = JS_InitClass(cx, obj, NULL, &js_IteratorClass, Iterator, 2,
NULL, iterator_methods, NULL, NULL);
if (!proto)
return NULL;
proto->slots[JSSLOT_ITER_STATE] = JSVAL_NULL;
#if JS_HAS_GENERATORS
/* Initialize the generator internals if configured. */
if (!JS_InitClass(cx, obj, NULL, &js_GeneratorClass, NULL, 0,
NULL, generator_methods, NULL, NULL)) {
return NULL;