Merge TM -> JM
This commit is contained in:
@@ -64,11 +64,9 @@
|
||||
#include "jsobj.h"
|
||||
#include "jsopcode.h"
|
||||
#include "jsproxy.h"
|
||||
#include "jsscan.h"
|
||||
#include "jsscope.h"
|
||||
#include "jsscript.h"
|
||||
#include "jsstaticcheck.h"
|
||||
#include "jstracer.h"
|
||||
#include "jsvector.h"
|
||||
|
||||
#if JS_HAS_XML_SUPPORT
|
||||
@@ -92,8 +90,7 @@ static JSObject *iterator_iterator(JSContext *cx, JSObject *obj, JSBool keysonly
|
||||
|
||||
Class js_IteratorClass = {
|
||||
"Iterator",
|
||||
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator) |
|
||||
JSCLASS_MARK_IS_TRACE,
|
||||
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator),
|
||||
PropertyStub, /* addProperty */
|
||||
PropertyStub, /* delProperty */
|
||||
PropertyStub, /* getProperty */
|
||||
@@ -108,7 +105,7 @@ Class js_IteratorClass = {
|
||||
NULL, /* construct */
|
||||
NULL, /* xdrObject */
|
||||
NULL, /* hasInstance */
|
||||
JS_CLASS_TRACE(iterator_trace),
|
||||
iterator_trace,
|
||||
{
|
||||
NULL, /* equality */
|
||||
NULL, /* outerObject */
|
||||
@@ -383,10 +380,7 @@ GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
|
||||
*/
|
||||
if (!(flags & JSITER_OWNONLY)) {
|
||||
JS_ASSERT(JSOp(*cx->regs->pc) == JSOP_ITER);
|
||||
TypeObject *getset = cx->getTypeGetSet();
|
||||
if (!getset)
|
||||
return false;
|
||||
if (!cx->fp()->script()->typeMonitorResult(cx, cx->regs->pc, (jstype) getset))
|
||||
if (!cx->fp()->script()->typeMonitorUnknown(cx, cx->regs->pc))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -446,12 +440,11 @@ NewIteratorObject(JSContext *cx, uintN flags)
|
||||
if (!obj)
|
||||
return false;
|
||||
|
||||
TypeObject *type = cx->getTypeEmpty();
|
||||
if (!type)
|
||||
return false;
|
||||
|
||||
obj->init(cx, &js_IteratorClass, type, NULL, NULL, false);
|
||||
obj->setMap(cx->compartment->emptyEnumeratorShape);
|
||||
EmptyShape *emptyEnumeratorShape = EmptyShape::getEmptyEnumeratorShape(cx);
|
||||
if (!emptyEnumeratorShape)
|
||||
return NULL;
|
||||
obj->init(cx, &js_IteratorClass, cx->getTypeEmpty(), NULL, NULL, false);
|
||||
obj->setMap(emptyEnumeratorShape);
|
||||
return obj;
|
||||
}
|
||||
|
||||
@@ -1124,7 +1117,7 @@ generator_trace(JSTracer *trc, JSObject *obj)
|
||||
Class js_GeneratorClass = {
|
||||
js_Generator_str,
|
||||
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Generator) |
|
||||
JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
|
||||
JSCLASS_IS_ANONYMOUS,
|
||||
PropertyStub, /* addProperty */
|
||||
PropertyStub, /* delProperty */
|
||||
PropertyStub, /* getProperty */
|
||||
@@ -1139,7 +1132,7 @@ Class js_GeneratorClass = {
|
||||
NULL, /* construct */
|
||||
NULL, /* xdrObject */
|
||||
NULL, /* hasInstance */
|
||||
JS_CLASS_TRACE(generator_trace),
|
||||
generator_trace,
|
||||
{
|
||||
NULL, /* equality */
|
||||
NULL, /* outerObject */
|
||||
@@ -1410,7 +1403,7 @@ generator_op(JSContext *cx, JSGeneratorOp op, Value *vp, uintN argc)
|
||||
default:
|
||||
JS_ASSERT(op == JSGENOP_CLOSE);
|
||||
gen->state = JSGEN_CLOSED;
|
||||
vp->setUndefined();
|
||||
JS_SET_RVAL(cx, vp, UndefinedValue());
|
||||
return JS_TRUE;
|
||||
}
|
||||
} else if (gen->state == JSGEN_CLOSED) {
|
||||
@@ -1424,7 +1417,7 @@ generator_op(JSContext *cx, JSGeneratorOp op, Value *vp, uintN argc)
|
||||
return JS_FALSE;
|
||||
default:
|
||||
JS_ASSERT(op == JSGENOP_CLOSE);
|
||||
vp->setUndefined();
|
||||
JS_SET_RVAL(cx, vp, UndefinedValue());
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1432,7 +1425,8 @@ generator_op(JSContext *cx, JSGeneratorOp op, Value *vp, uintN argc)
|
||||
bool undef = ((op == JSGENOP_SEND || op == JSGENOP_THROW) && argc != 0);
|
||||
if (!SendToGenerator(cx, op, obj, gen, undef ? vp[2] : UndefinedValue()))
|
||||
return JS_FALSE;
|
||||
*vp = gen->floatingFrame()->returnValue();
|
||||
|
||||
JS_SET_RVAL(cx, vp, gen->floatingFrame()->returnValue());
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user