Sha256: 82eee2838d04e76758577ee075f2cbb48ea4a58a4654828e44ce39e99faf9be3

Contents?: true

Size: 777 Bytes

Versions: 5

Compression:

Stored size: 777 Bytes

Contents

#include "tests.h"

static int g_counter;

static JSBool
CounterAdd(JSContext *cx, JSObject *obj, jsval idval, jsval *vp)
{
    g_counter++;
    return JS_TRUE;
}

static JSClass CounterClass = {
    "Counter",  /* name */
    0,  /* flags */
    CounterAdd, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
    JSCLASS_NO_OPTIONAL_MEMBERS
};

BEGIN_TEST(testPropCache_bug505798)
{
    g_counter = 0;
    EXEC("var x = {};");
    CHECK(JS_DefineObject(cx, global, "y", &CounterClass, NULL, JSPROP_ENUMERATE));
    EXEC("var arr = [x, y];\n"
         "for (var i = 0; i < arr.length; i++)\n"
         "    arr[i].p = 1;\n");
    CHECK(g_counter == 1);
    return true;
}
END_TEST(testPropCache_bug505798)

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
johnson19-2.0.0.pre3 vendor/tracemonkey/jsapi-tests/testPropCache.cpp
pre-johnson-2.0.0 vendor/tracemonkey/jsapi-tests/testPropCache.cpp
johnson-2.0.0.pre3 vendor/tracemonkey/jsapi-tests/testPropCache.cpp
johnson-2.0.0.pre2 vendor/tracemonkey/jsapi-tests/testPropCache.cpp
johnson-2.0.0.pre1 vendor/tracemonkey/jsapi-tests/testPropCache.cpp