Attachment #508274: Add a 'strict' argument to C++ property setter functions. for bug #537873

View | Details | Raw Unified | Return to bug 537873
Collapse All | Expand All

(-)a/js/src/jsapi-tests/testClassGetter.cpp (-4 / +4 lines)
Line     Link Here 
 Lines 29-38   static JSClass ptestClass = { Link Here 
29
    "PTest",
29
    "PTest",
30
    JSCLASS_HAS_PRIVATE,
30
    JSCLASS_HAS_PRIVATE,
31
31
32
    JS_PropertyStub, // add
32
    JS_PropertyStub,       // add
33
    JS_PropertyStub, // delete
33
    JS_PropertyStub,       // delete
34
    test_prop_get,   // get
34
    test_prop_get,         // get
35
    JS_PropertyStub, // set
35
    JS_StrictPropertyStub, // set
36
    JS_EnumerateStub,
36
    JS_EnumerateStub,
37
    JS_ResolveStub,
37
    JS_ResolveStub,
38
    JS_ConvertStub,
38
    JS_ConvertStub,
(-)a/js/src/jsapi-tests/testCustomIterator.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 30-36   js::Class HasCustomIterClass = { Link Here 
30
    js::PropertyStub,
30
    js::PropertyStub,
31
    js::PropertyStub,
31
    js::PropertyStub,
32
    js::PropertyStub,
32
    js::PropertyStub,
33
    js::PropertyStub,
33
    js::StrictPropertyStub,
34
    js::EnumerateStub,
34
    js::EnumerateStub,
35
    js::ResolveStub,
35
    js::ResolveStub,
36
    js::ConvertStub,
36
    js::ConvertStub,
(-)a/js/src/jsapi-tests/testDefineGetterSetterNonEnumerable.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 35-47   BEGIN_TEST(testDefineGetterSetterNonEnum Link Here 
35
    CHECK(JS_DefineProperty(cx, JSVAL_TO_OBJECT(vobj), PROPERTY_NAME,
35
    CHECK(JS_DefineProperty(cx, JSVAL_TO_OBJECT(vobj), PROPERTY_NAME,
36
                            JSVAL_VOID,
36
                            JSVAL_VOID,
37
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funGetObj),
37
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funGetObj),
38
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funSetObj),
38
                            JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, funSetObj),
39
                            JSPROP_GETTER | JSPROP_SETTER | JSPROP_ENUMERATE));
39
                            JSPROP_GETTER | JSPROP_SETTER | JSPROP_ENUMERATE));
40
40
41
    CHECK(JS_DefineProperty(cx, JSVAL_TO_OBJECT(vobj), PROPERTY_NAME,
41
    CHECK(JS_DefineProperty(cx, JSVAL_TO_OBJECT(vobj), PROPERTY_NAME,
42
                            JSVAL_VOID,
42
                            JSVAL_VOID,
43
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funGetObj),
43
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funGetObj),
44
                            JS_DATA_TO_FUNC_PTR(JSPropertyOp, funSetObj),
44
                            JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, funSetObj),
45
                            JSPROP_GETTER | JSPROP_SETTER | JSPROP_PERMANENT));
45
                            JSPROP_GETTER | JSPROP_SETTER | JSPROP_PERMANENT));
46
46
47
    JSBool found = JS_FALSE;
47
    JSBool found = JS_FALSE;
(-)a/js/src/jsapi-tests/testExtendedEq.cpp (-4 / +4 lines)
Line     Link Here 
 Lines 18-27   my_Equality(JSContext *cx, JSObject *obj Link Here 
18
js::Class TestExtendedEq_JSClass = {
18
js::Class TestExtendedEq_JSClass = {
19
    "TestExtendedEq",
19
    "TestExtendedEq",
20
    0,
20
    0,
21
    js::PropertyStub, /* addProperty */
21
    js::PropertyStub,       /* addProperty */
22
    js::PropertyStub, /* delProperty */
22
    js::PropertyStub,       /* delProperty */
23
    js::PropertyStub, /* getProperty */
23
    js::PropertyStub,       /* getProperty */
24
    js::PropertyStub, /* setProperty */
24
    js::StrictPropertyStub, /* setProperty */
25
    JS_EnumerateStub,
25
    JS_EnumerateStub,
26
    JS_ResolveStub,
26
    JS_ResolveStub,
27
    NULL,           /* convert */
27
    NULL,           /* convert */
(-)a/js/src/jsapi-tests/testLookup.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 56-62   document_resolve(JSContext *cx, JSObject Link Here 
56
56
57
static JSClass document_class = {
57
static JSClass document_class = {
58
    "document", JSCLASS_NEW_RESOLVE,
58
    "document", JSCLASS_NEW_RESOLVE,
59
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
59
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
60
    JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub, JS_FinalizeStub,
60
    JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub, JS_FinalizeStub,
61
    JSCLASS_NO_OPTIONAL_MEMBERS
61
    JSCLASS_NO_OPTIONAL_MEMBERS
62
};
62
};
(-)a/js/src/jsapi-tests/testNewObject.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 84-90   BEGIN_TEST(testNewObject_1) Link Here 
84
    static JSClass cls = {
84
    static JSClass cls = {
85
        "testNewObject_1",
85
        "testNewObject_1",
86
        0,
86
        0,
87
        JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
87
        JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
88
        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
88
        JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
89
        NULL, NULL, NULL, constructHook, NULL, NULL, NULL, NULL
89
        NULL, NULL, NULL, constructHook, NULL, NULL, NULL, NULL
90
    };
90
    };
(-)a/js/src/jsapi-tests/testOps.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 17-23   my_convert(JSContext* context, JSObject* Link Here 
17
static JSClass myClass = {
17
static JSClass myClass = {
18
    "MyClass",
18
    "MyClass",
19
    0,
19
    0,
20
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
20
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
21
    JS_EnumerateStub, JS_ResolveStub, my_convert, JS_FinalizeStub,
21
    JS_EnumerateStub, JS_ResolveStub, my_convert, JS_FinalizeStub,
22
    JSCLASS_NO_OPTIONAL_MEMBERS
22
    JSCLASS_NO_OPTIONAL_MEMBERS
23
};
23
};
(-)a/js/src/jsapi-tests/testPropCache.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 16-22   CounterAdd(JSContext *cx, JSObject *obj, Link Here 
16
static JSClass CounterClass = {
16
static JSClass CounterClass = {
17
    "Counter",  /* name */
17
    "Counter",  /* name */
18
    0,  /* flags */
18
    0,  /* flags */
19
    CounterAdd, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
19
    CounterAdd, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
20
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
20
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
21
    JSCLASS_NO_OPTIONAL_MEMBERS
21
    JSCLASS_NO_OPTIONAL_MEMBERS
22
};
22
};
(-)a/js/src/jsapi-tests/testSetProperty.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 20-30   BEGIN_TEST(testSetProperty_NativeGetterS Link Here 
20
    vobj = OBJECT_TO_JSVAL(obj);
20
    vobj = OBJECT_TO_JSVAL(obj);
21
21
22
    CHECK(JS_DefineProperty(cx, global, "globalProp", vobj,
22
    CHECK(JS_DefineProperty(cx, global, "globalProp", vobj,
23
                            JS_PropertyStub, JS_PropertyStub,
23
                            JS_PropertyStub, JS_StrictPropertyStub,
24
                            JSPROP_ENUMERATE));
24
                            JSPROP_ENUMERATE));
25
25
26
    CHECK(JS_DefineProperty(cx, obj, "prop", JSVAL_VOID,
26
    CHECK(JS_DefineProperty(cx, obj, "prop", JSVAL_VOID,
27
                            nativeGet, JS_PropertyStub,
27
                            nativeGet, JS_StrictPropertyStub,
28
                            JSPROP_SHARED));
28
                            JSPROP_SHARED));
29
29
30
    EXEC("'use strict';                                     \n"
30
    EXEC("'use strict';                                     \n"
(-)a/js/src/jsapi-tests/tests.h (-1 / +1 lines)
Line     Link Here 
 Lines 227-233   class JSAPITest Link Here 
227
    static JSClass * basicGlobalClass() {
227
    static JSClass * basicGlobalClass() {
228
        static JSClass c = {
228
        static JSClass c = {
229
            "global", JSCLASS_GLOBAL_FLAGS,
229
            "global", JSCLASS_GLOBAL_FLAGS,
230
            JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
230
            JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
231
            JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
231
            JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
232
            JSCLASS_NO_OPTIONAL_MEMBERS
232
            JSCLASS_NO_OPTIONAL_MEMBERS
233
        };
233
        };
(-)a/js/src/jsapi.cpp (-22 / +29 lines)
Line     Link Here 
 Lines 116-122   static JSClass dummy_class = { Link Here 
116
    "jdummy",
116
    "jdummy",
117
    JSCLASS_GLOBAL_FLAGS,
117
    JSCLASS_GLOBAL_FLAGS,
118
    JS_PropertyStub,  JS_PropertyStub,
118
    JS_PropertyStub,  JS_PropertyStub,
119
    JS_PropertyStub,  JS_PropertyStub,
119
    JS_PropertyStub,  JS_StrictPropertyStub,
120
    JS_EnumerateStub, JS_ResolveStub,
120
    JS_EnumerateStub, JS_ResolveStub,
121
    JS_ConvertStub,   NULL,
121
    JS_ConvertStub,   NULL,
122
    JSCLASS_NO_OPTIONAL_MEMBERS
122
    JSCLASS_NO_OPTIONAL_MEMBERS
 Lines 1464-1470   JS_InitStandardClasses(JSContext *cx, JS Link Here 
1464
    /* Define a top-level property 'undefined' with the undefined value. */
1464
    /* Define a top-level property 'undefined' with the undefined value. */
1465
    JSAtom *atom = cx->runtime->atomState.typeAtoms[JSTYPE_VOID];
1465
    JSAtom *atom = cx->runtime->atomState.typeAtoms[JSTYPE_VOID];
1466
    if (!obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1466
    if (!obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1467
                             PropertyStub, PropertyStub,
1467
                             PropertyStub, StrictPropertyStub,
1468
                             JSPROP_PERMANENT | JSPROP_READONLY)) {
1468
                             JSPROP_PERMANENT | JSPROP_READONLY)) {
1469
        return JS_FALSE;
1469
        return JS_FALSE;
1470
    }
1470
    }
 Lines 1670-1676   JS_ResolveStandardClass(JSContext *cx, J Link Here 
1670
    if (idstr == ATOM_TO_STRING(atom)) {
1670
    if (idstr == ATOM_TO_STRING(atom)) {
1671
        *resolved = JS_TRUE;
1671
        *resolved = JS_TRUE;
1672
        return obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1672
        return obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1673
                                   PropertyStub, PropertyStub,
1673
                                   PropertyStub, StrictPropertyStub,
1674
                                   JSPROP_PERMANENT | JSPROP_READONLY);
1674
                                   JSPROP_PERMANENT | JSPROP_READONLY);
1675
    }
1675
    }
1676
1676
 Lines 1752-1758   JS_EnumerateStandardClasses(JSContext *c Link Here 
1752
    atom = rt->atomState.typeAtoms[JSTYPE_VOID];
1752
    atom = rt->atomState.typeAtoms[JSTYPE_VOID];
1753
    if (!obj->nativeContains(ATOM_TO_JSID(atom)) &&
1753
    if (!obj->nativeContains(ATOM_TO_JSID(atom)) &&
1754
        !obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1754
        !obj->defineProperty(cx, ATOM_TO_JSID(atom), UndefinedValue(),
1755
                             PropertyStub, PropertyStub,
1755
                             PropertyStub, StrictPropertyStub,
1756
                             JSPROP_PERMANENT | JSPROP_READONLY)) {
1756
                             JSPROP_PERMANENT | JSPROP_READONLY)) {
1757
        return JS_FALSE;
1757
        return JS_FALSE;
1758
    }
1758
    }
 Lines 2773-2778   JS_PropertyStub(JSContext *cx, JSObject Link Here 
2773
}
2773
}
2774
2774
2775
JS_PUBLIC_API(JSBool)
2775
JS_PUBLIC_API(JSBool)
2776
JS_StrictPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
2777
{
2778
    return JS_TRUE;
2779
}
2780
2781
JS_PUBLIC_API(JSBool)
2776
JS_EnumerateStub(JSContext *cx, JSObject *obj)
2782
JS_EnumerateStub(JSContext *cx, JSObject *obj)
2777
{
2783
{
2778
    return JS_TRUE;
2784
    return JS_TRUE;
 Lines 3267-3273   JS_AlreadyHasOwnUCProperty(JSContext *cx Link Here 
3267
3273
3268
static JSBool
3274
static JSBool
3269
DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, const Value &value,
3275
DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, const Value &value,
3270
                   PropertyOp getter, PropertyOp setter, uintN attrs,
3276
                   PropertyOp getter, StrictPropertyOp setter, uintN attrs,
3271
                   uintN flags, intN tinyid)
3277
                   uintN flags, intN tinyid)
3272
{
3278
{
3273
    CHECK_REQUEST(cx);
3279
    CHECK_REQUEST(cx);
 Lines 3289-3295   DefinePropertyById(JSContext *cx, JSObje Link Here 
3289
3295
3290
JS_PUBLIC_API(JSBool)
3296
JS_PUBLIC_API(JSBool)
3291
JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
3297
JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
3292
                      JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
3298
                      JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3293
{
3299
{
3294
    return DefinePropertyById(cx, obj, id, Valueify(value), Valueify(getter),
3300
    return DefinePropertyById(cx, obj, id, Valueify(value), Valueify(getter),
3295
                              Valueify(setter), attrs, 0, 0);
3301
                              Valueify(setter), attrs, 0, 0);
 Lines 3297-3303   JS_DefinePropertyById(JSContext *cx, JSO Link Here 
3297
3303
3298
JS_PUBLIC_API(JSBool)
3304
JS_PUBLIC_API(JSBool)
3299
JS_DefineElement(JSContext *cx, JSObject *obj, jsint index, jsval value,
3305
JS_DefineElement(JSContext *cx, JSObject *obj, jsint index, jsval value,
3300
                 JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
3306
                 JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3301
{
3307
{
3302
    return DefinePropertyById(cx, obj, INT_TO_JSID(index), Valueify(value),
3308
    return DefinePropertyById(cx, obj, INT_TO_JSID(index), Valueify(value),
3303
                              Valueify(getter), Valueify(setter), attrs, 0, 0);
3309
                              Valueify(getter), Valueify(setter), attrs, 0, 0);
 Lines 3305-3311   JS_DefineElement(JSContext *cx, JSObject Link Here 
3305
3311
3306
static JSBool
3312
static JSBool
3307
DefineProperty(JSContext *cx, JSObject *obj, const char *name, const Value &value,
3313
DefineProperty(JSContext *cx, JSObject *obj, const char *name, const Value &value,
3308
               PropertyOp getter, PropertyOp setter, uintN attrs,
3314
               PropertyOp getter, StrictPropertyOp setter, uintN attrs,
3309
               uintN flags, intN tinyid)
3315
               uintN flags, intN tinyid)
3310
{
3316
{
3311
    jsid id;
3317
    jsid id;
 Lines 3326-3332   DefineProperty(JSContext *cx, JSObject * Link Here 
3326
3332
3327
JS_PUBLIC_API(JSBool)
3333
JS_PUBLIC_API(JSBool)
3328
JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
3334
JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
3329
                  JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
3335
                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3330
{
3336
{
3331
    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
3337
    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
3332
                          Valueify(setter), attrs, 0, 0);
3338
                          Valueify(setter), attrs, 0, 0);
 Lines 3334-3340   JS_DefineProperty(JSContext *cx, JSObjec Link Here 
3334
3340
3335
JS_PUBLIC_API(JSBool)
3341
JS_PUBLIC_API(JSBool)
3336
JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8 tinyid,
3342
JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name, int8 tinyid,
3337
                            jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
3343
                            jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3338
{
3344
{
3339
    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
3345
    return DefineProperty(cx, obj, name, Valueify(value), Valueify(getter),
3340
                          Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
3346
                          Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
 Lines 3342-3348   JS_DefinePropertyWithTinyId(JSContext *c Link Here 
3342
3348
3343
static JSBool
3349
static JSBool
3344
DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3350
DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3345
                 const Value &value, PropertyOp getter, PropertyOp setter, uintN attrs,
3351
                 const Value &value, PropertyOp getter, StrictPropertyOp setter, uintN attrs,
3346
                 uintN flags, intN tinyid)
3352
                 uintN flags, intN tinyid)
3347
{
3353
{
3348
    JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
3354
    JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
 Lines 3352-3358   DefineUCProperty(JSContext *cx, JSObject Link Here 
3352
3358
3353
JS_PUBLIC_API(JSBool)
3359
JS_PUBLIC_API(JSBool)
3354
JS_DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3360
JS_DefineUCProperty(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3355
                    jsval value, JSPropertyOp getter, JSPropertyOp setter, uintN attrs)
3361
                    jsval value, JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3356
{
3362
{
3357
    return DefineUCProperty(cx, obj, name, namelen, Valueify(value),
3363
    return DefineUCProperty(cx, obj, name, namelen, Valueify(value),
3358
                            Valueify(getter), Valueify(setter), attrs, 0, 0);
3364
                            Valueify(getter), Valueify(setter), attrs, 0, 0);
 Lines 3360-3367   JS_DefineUCProperty(JSContext *cx, JSObj Link Here 
3360
3366
3361
JS_PUBLIC_API(JSBool)
3367
JS_PUBLIC_API(JSBool)
3362
JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3368
JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj, const jschar *name, size_t namelen,
3363
                              int8 tinyid, jsval value, JSPropertyOp getter, JSPropertyOp setter,
3369
                              int8 tinyid, jsval value,
3364
                              uintN attrs)
3370
                              JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs)
3365
{
3371
{
3366
    return DefineUCProperty(cx, obj, name, namelen, Valueify(value), Valueify(getter),
3372
    return DefineUCProperty(cx, obj, name, namelen, Valueify(value), Valueify(getter),
3367
                            Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
3373
                            Valueify(setter), attrs, Shape::HAS_SHORTID, tinyid);
 Lines 3530-3536   GetPropertyDescriptorById(JSContext *cx, Link Here 
3530
        desc->attrs = shape->attributes();
3536
        desc->attrs = shape->attributes();
3531
3537
3532
        if (shape->isMethod()) {
3538
        if (shape->isMethod()) {
3533
            desc->getter = desc->setter = PropertyStub;
3539
            desc->getter = PropertyStub;
3540
            desc->setter = StrictPropertyStub;
3534
            desc->value.setObject(shape->methodObject());
3541
            desc->value.setObject(shape->methodObject());
3535
        } else {
3542
        } else {
3536
            desc->getter = shape->getter();
3543
            desc->getter = shape->getter();
 Lines 3566-3572   JS_GetPropertyDescriptorById(JSContext * Link Here 
3566
JS_PUBLIC_API(JSBool)
3573
JS_PUBLIC_API(JSBool)
3567
JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj, jsid id,
3574
JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj, jsid id,
3568
                                       uintN *attrsp, JSBool *foundp,
3575
                                       uintN *attrsp, JSBool *foundp,
3569
                                       JSPropertyOp *getterp, JSPropertyOp *setterp)
3576
                                       JSPropertyOp *getterp, JSStrictPropertyOp *setterp)
3570
{
3577
{
3571
    PropertyDescriptor desc;
3578
    PropertyDescriptor desc;
3572
    if (!GetPropertyDescriptorById(cx, obj, id, JSRESOLVE_QUALIFIED, JS_FALSE, &desc))
3579
    if (!GetPropertyDescriptorById(cx, obj, id, JSRESOLVE_QUALIFIED, JS_FALSE, &desc))
 Lines 3602-3608   JS_GetUCPropertyAttributes(JSContext *cx Link Here 
3602
JS_PUBLIC_API(JSBool)
3609
JS_PUBLIC_API(JSBool)
3603
JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj, const char *name,
3610
JS_GetPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj, const char *name,
3604
                                   uintN *attrsp, JSBool *foundp,
3611
                                   uintN *attrsp, JSBool *foundp,
3605
                                   JSPropertyOp *getterp, JSPropertyOp *setterp)
3612
                                   JSPropertyOp *getterp, JSStrictPropertyOp *setterp)
3606
{
3613
{
3607
    JSAtom *atom = js_Atomize(cx, name, strlen(name), 0);
3614
    JSAtom *atom = js_Atomize(cx, name, strlen(name), 0);
3608
    return atom && JS_GetPropertyAttrsGetterAndSetterById(cx, obj, ATOM_TO_JSID(atom),
3615
    return atom && JS_GetPropertyAttrsGetterAndSetterById(cx, obj, ATOM_TO_JSID(atom),
 Lines 3613-3619   JS_PUBLIC_API(JSBool) Link Here 
3613
JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,
3620
JS_GetUCPropertyAttrsGetterAndSetter(JSContext *cx, JSObject *obj,
3614
                                     const jschar *name, size_t namelen,
3621
                                     const jschar *name, size_t namelen,
3615
                                     uintN *attrsp, JSBool *foundp,
3622
                                     uintN *attrsp, JSBool *foundp,
3616
                                     JSPropertyOp *getterp, JSPropertyOp *setterp)
3623
                                     JSPropertyOp *getterp, JSStrictPropertyOp *setterp)
3617
{
3624
{
3618
    JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
3625
    JSAtom *atom = js_AtomizeChars(cx, name, AUTO_NAMELEN(name, namelen), 0);
3619
    return atom && JS_GetPropertyAttrsGetterAndSetterById(cx, obj, ATOM_TO_JSID(atom),
3626
    return atom && JS_GetPropertyAttrsGetterAndSetterById(cx, obj, ATOM_TO_JSID(atom),
 Lines 3887-3896   static Class prop_iter_class = { Link Here 
3887
    "PropertyIterator",
3894
    "PropertyIterator",
3888
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1) |
3895
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1) |
3889
    JSCLASS_MARK_IS_TRACE,
3896
    JSCLASS_MARK_IS_TRACE,
3890
    PropertyStub,   /* addProperty */
3897
    PropertyStub,         /* addProperty */
3891
    PropertyStub,   /* delProperty */
3898
    PropertyStub,         /* delProperty */
3892
    PropertyStub,   /* getProperty */
3899
    PropertyStub,         /* getProperty */
3893
    PropertyStub,   /* setProperty */
3900
    StrictPropertyStub,   /* setProperty */
3894
    EnumerateStub,
3901
    EnumerateStub,
3895
    ResolveStub,
3902
    ResolveStub,
3896
    ConvertStub,
3903
    ConvertStub,
(-)a/js/src/jsapi.h (-15 / +18 lines)
Line     Link Here 
 Lines 1878-1884   struct JSClass { Link Here 
1878
    JSPropertyOp        addProperty;
1878
    JSPropertyOp        addProperty;
1879
    JSPropertyOp        delProperty;
1879
    JSPropertyOp        delProperty;
1880
    JSPropertyOp        getProperty;
1880
    JSPropertyOp        getProperty;
1881
    JSPropertyOp        setProperty;
1881
    JSStrictPropertyOp  setProperty;
1882
    JSEnumerateOp       enumerate;
1882
    JSEnumerateOp       enumerate;
1883
    JSResolveOp         resolve;
1883
    JSResolveOp         resolve;
1884
    JSConvertOp         convert;
1884
    JSConvertOp         convert;
 Lines 2003-2008   extern JS_PUBLIC_API(JSBool) Link Here 
2003
JS_PropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
2003
JS_PropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
2004
2004
2005
extern JS_PUBLIC_API(JSBool)
2005
extern JS_PUBLIC_API(JSBool)
2006
JS_StrictPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool, jsval *vp);
2007
2008
extern JS_PUBLIC_API(JSBool)
2006
JS_EnumerateStub(JSContext *cx, JSObject *obj);
2009
JS_EnumerateStub(JSContext *cx, JSObject *obj);
2007
2010
2008
extern JS_PUBLIC_API(JSBool)
2011
extern JS_PUBLIC_API(JSBool)
 Lines 2027-2037   struct JSConstDoubleSpec { Link Here 
2027
 * JSPROP_INDEX bit in flags.
2030
 * JSPROP_INDEX bit in flags.
2028
 */
2031
 */
2029
struct JSPropertySpec {
2032
struct JSPropertySpec {
2030
    const char      *name;
2033
    const char            *name;
2031
    int8            tinyid;
2034
    int8                  tinyid;
2032
    uint8           flags;
2035
    uint8                 flags;
2033
    JSPropertyOp    getter;
2036
    JSPropertyOp          getter;
2034
    JSPropertyOp    setter;
2037
    JSStrictPropertyOp    setter;
2035
};
2038
};
2036
2039
2037
struct JSFunctionSpec {
2040
struct JSFunctionSpec {
 Lines 2172-2182   JS_DefineProperties(JSContext *cx, JSObj Link Here 
2172
2175
2173
extern JS_PUBLIC_API(JSBool)
2176
extern JS_PUBLIC_API(JSBool)
2174
JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
2177
JS_DefineProperty(JSContext *cx, JSObject *obj, const char *name, jsval value,
2175
                  JSPropertyOp getter, JSPropertyOp setter, uintN attrs);
2178
                  JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
2176
2179
2177
extern JS_PUBLIC_API(JSBool)
2180
extern JS_PUBLIC_API(JSBool)
2178
JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
2181
JS_DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
2179
                      JSPropertyOp getter, JSPropertyOp setter, uintN attrs);
2182
                      JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
2180
2183
2181
extern JS_PUBLIC_API(JSBool)
2184
extern JS_PUBLIC_API(JSBool)
2182
JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);
2185
JS_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id, jsval descriptor, JSBool *bp);
 Lines 2201-2214   JS_GetPropertyAttrsGetterAndSetter(JSCon Link Here 
2201
                                   const char *name,
2204
                                   const char *name,
2202
                                   uintN *attrsp, JSBool *foundp,
2205
                                   uintN *attrsp, JSBool *foundp,
2203
                                   JSPropertyOp *getterp,
2206
                                   JSPropertyOp *getterp,
2204
                                   JSPropertyOp *setterp);
2207
                                   JSStrictPropertyOp *setterp);
2205
2208
2206
extern JS_PUBLIC_API(JSBool)
2209
extern JS_PUBLIC_API(JSBool)
2207
JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,
2210
JS_GetPropertyAttrsGetterAndSetterById(JSContext *cx, JSObject *obj,
2208
                                       jsid id,
2211
                                       jsid id,
2209
                                       uintN *attrsp, JSBool *foundp,
2212
                                       uintN *attrsp, JSBool *foundp,
2210
                                       JSPropertyOp *getterp,
2213
                                       JSPropertyOp *getterp,
2211
                                       JSPropertyOp *setterp);
2214
                                       JSStrictPropertyOp *setterp);
2212
2215
2213
/*
2216
/*
2214
 * Set the attributes of a property on a given object.
2217
 * Set the attributes of a property on a given object.
 Lines 2223-2229   JS_SetPropertyAttributes(JSContext *cx, Link Here 
2223
extern JS_PUBLIC_API(JSBool)
2226
extern JS_PUBLIC_API(JSBool)
2224
JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,
2227
JS_DefinePropertyWithTinyId(JSContext *cx, JSObject *obj, const char *name,
2225
                            int8 tinyid, jsval value,
2228
                            int8 tinyid, jsval value,
2226
                            JSPropertyOp getter, JSPropertyOp setter,
2229
                            JSPropertyOp getter, JSStrictPropertyOp setter,
2227
                            uintN attrs);
2230
                            uintN attrs);
2228
2231
2229
extern JS_PUBLIC_API(JSBool)
2232
extern JS_PUBLIC_API(JSBool)
 Lines 2321-2327   JS_DeletePropertyById2(JSContext *cx, JS Link Here 
2321
extern JS_PUBLIC_API(JSBool)
2324
extern JS_PUBLIC_API(JSBool)
2322
JS_DefineUCProperty(JSContext *cx, JSObject *obj,
2325
JS_DefineUCProperty(JSContext *cx, JSObject *obj,
2323
                    const jschar *name, size_t namelen, jsval value,
2326
                    const jschar *name, size_t namelen, jsval value,
2324
                    JSPropertyOp getter, JSPropertyOp setter,
2327
                    JSPropertyOp getter, JSStrictPropertyOp setter,
2325
                    uintN attrs);
2328
                    uintN attrs);
2326
2329
2327
/*
2330
/*
 Lines 2345-2351   JS_GetUCPropertyAttrsGetterAndSetter(JSC Link Here 
2345
                                     const jschar *name, size_t namelen,
2348
                                     const jschar *name, size_t namelen,
2346
                                     uintN *attrsp, JSBool *foundp,
2349
                                     uintN *attrsp, JSBool *foundp,
2347
                                     JSPropertyOp *getterp,
2350
                                     JSPropertyOp *getterp,
2348
                                     JSPropertyOp *setterp);
2351
                                     JSStrictPropertyOp *setterp);
2349
2352
2350
/*
2353
/*
2351
 * Set the attributes of a property on a given object.
2354
 * Set the attributes of a property on a given object.
 Lines 2363-2369   extern JS_PUBLIC_API(JSBool) Link Here 
2363
JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,
2366
JS_DefineUCPropertyWithTinyId(JSContext *cx, JSObject *obj,
2364
                              const jschar *name, size_t namelen,
2367
                              const jschar *name, size_t namelen,
2365
                              int8 tinyid, jsval value,
2368
                              int8 tinyid, jsval value,
2366
                              JSPropertyOp getter, JSPropertyOp setter,
2369
                              JSPropertyOp getter, JSStrictPropertyOp setter,
2367
                              uintN attrs);
2370
                              uintN attrs);
2368
2371
2369
extern JS_PUBLIC_API(JSBool)
2372
extern JS_PUBLIC_API(JSBool)
 Lines 2412-2418   JS_HasArrayLength(JSContext *cx, JSObjec Link Here 
2412
2415
2413
extern JS_PUBLIC_API(JSBool)
2416
extern JS_PUBLIC_API(JSBool)
2414
JS_DefineElement(JSContext *cx, JSObject *obj, jsint index, jsval value,
2417
JS_DefineElement(JSContext *cx, JSObject *obj, jsint index, jsval value,
2415
                 JSPropertyOp getter, JSPropertyOp setter, uintN attrs);
2418
                 JSPropertyOp getter, JSStrictPropertyOp setter, uintN attrs);
2416
2419
2417
extern JS_PUBLIC_API(JSBool)
2420
extern JS_PUBLIC_API(JSBool)
2418
JS_AliasElement(JSContext *cx, JSObject *obj, const char *name, jsint alias);
2421
JS_AliasElement(JSContext *cx, JSObject *obj, const char *name, jsint alias);
(-)a/js/src/jsarray.cpp (-10 / +10 lines)
Line     Link Here 
 Lines 589-595   array_length_getter(JSContext *cx, JSObj Link Here 
589
}
589
}
590
590
591
static JSBool
591
static JSBool
592
array_length_setter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
592
array_length_setter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
593
{
593
{
594
    jsuint newlen, oldlen, gap, index;
594
    jsuint newlen, oldlen, gap, index;
595
    Value junk;
595
    Value junk;
 Lines 797-803   array_setProperty(JSContext *cx, JSObjec Link Here 
797
    uint32 i;
797
    uint32 i;
798
798
799
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
799
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
800
        return array_length_setter(cx, obj, id, vp);
800
        return array_length_setter(cx, obj, id, strict, vp);
801
801
802
    if (!obj->isDenseArray())
802
    if (!obj->isDenseArray())
803
        return js_SetProperty(cx, obj, id, vp, strict);
803
        return js_SetProperty(cx, obj, id, vp, strict);
 Lines 851-857   js_PrototypeHasIndexedProperties(JSConte Link Here 
851
851
852
static JSBool
852
static JSBool
853
array_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
853
array_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
854
                     PropertyOp getter, PropertyOp setter, uintN attrs)
854
                     PropertyOp getter, StrictPropertyOp setter, uintN attrs)
855
{
855
{
856
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
856
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
857
        return JS_TRUE;
857
        return JS_TRUE;
 Lines 955-964   Class js_ArrayClass = { Link Here 
955
    Class::NON_NATIVE |
955
    Class::NON_NATIVE |
956
    JSCLASS_HAS_PRIVATE |
956
    JSCLASS_HAS_PRIVATE |
957
    JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
957
    JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
958
    PropertyStub,   /* addProperty */
958
    PropertyStub,         /* addProperty */
959
    PropertyStub,   /* delProperty */
959
    PropertyStub,         /* delProperty */
960
    PropertyStub,   /* getProperty */
960
    PropertyStub,         /* getProperty */
961
    PropertyStub,   /* setProperty */
961
    StrictPropertyStub,   /* setProperty */
962
    EnumerateStub,
962
    EnumerateStub,
963
    ResolveStub,
963
    ResolveStub,
964
    js_TryValueOf,
964
    js_TryValueOf,
 Lines 993-1001   Class js_SlowArrayClass = { Link Here 
993
    JSCLASS_HAS_PRIVATE |
993
    JSCLASS_HAS_PRIVATE |
994
    JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
994
    JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
995
    slowarray_addProperty,
995
    slowarray_addProperty,
996
    PropertyStub,   /* delProperty */
996
    PropertyStub,         /* delProperty */
997
    PropertyStub,   /* getProperty */
997
    PropertyStub,         /* getProperty */
998
    PropertyStub,   /* setProperty */
998
    StrictPropertyStub,   /* setProperty */
999
    EnumerateStub,
999
    EnumerateStub,
1000
    ResolveStub,
1000
    ResolveStub,
1001
    js_TryValueOf
1001
    js_TryValueOf
(-)a/js/src/jsbool.cpp (-4 / +4 lines)
Line     Link Here 
 Lines 63-72   Class js_BooleanClass = { Link Here 
63
    "Boolean",
63
    "Boolean",
64
    JSCLASS_HAS_RESERVED_SLOTS(1) |
64
    JSCLASS_HAS_RESERVED_SLOTS(1) |
65
    JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean),
65
    JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean),
66
    PropertyStub,   /* addProperty */
66
    PropertyStub,         /* addProperty */
67
    PropertyStub,   /* delProperty */
67
    PropertyStub,         /* delProperty */
68
    PropertyStub,   /* getProperty */
68
    PropertyStub,         /* getProperty */
69
    PropertyStub,   /* setProperty */
69
    StrictPropertyStub,   /* setProperty */
70
    EnumerateStub,
70
    EnumerateStub,
71
    ResolveStub,
71
    ResolveStub,
72
    ConvertStub
72
    ConvertStub
(-)a/js/src/jscntxtinlines.h (-5 / +6 lines)
Line     Link Here 
 Lines 740-754   CallJSPropertyOp(JSContext *cx, js::Prop Link Here 
740
}
740
}
741
741
742
JS_ALWAYS_INLINE bool
742
JS_ALWAYS_INLINE bool
743
CallJSPropertyOpSetter(JSContext *cx, js::PropertyOp op, JSObject *obj, jsid id, js::Value *vp)
743
CallJSPropertyOpSetter(JSContext *cx, js::StrictPropertyOp op, JSObject *obj, jsid id,
744
                       JSBool strict, js::Value *vp)
744
{
745
{
745
    assertSameCompartment(cx, obj, id, *vp);
746
    assertSameCompartment(cx, obj, id, *vp);
746
    return op(cx, obj, id, vp);
747
    return op(cx, obj, id, strict, vp);
747
}
748
}
748
749
749
inline bool
750
inline bool
750
CallSetter(JSContext *cx, JSObject *obj, jsid id, PropertyOp op, uintN attrs, uintN shortid,
751
CallSetter(JSContext *cx, JSObject *obj, jsid id, js::StrictPropertyOp op, uintN attrs,
751
           js::Value *vp)
752
           uintN shortid, JSBool strict, js::Value *vp)
752
{
753
{
753
    if (attrs & JSPROP_SETTER)
754
    if (attrs & JSPROP_SETTER)
754
        return ExternalGetOrSet(cx, obj, id, CastAsObjectJsval(op), JSACC_WRITE, 1, vp, vp);
755
        return ExternalGetOrSet(cx, obj, id, CastAsObjectJsval(op), JSACC_WRITE, 1, vp, vp);
 Lines 758-764   CallSetter(JSContext *cx, JSObject *obj, Link Here 
758
759
759
    if (attrs & JSPROP_SHORTID)
760
    if (attrs & JSPROP_SHORTID)
760
        id = INT_TO_JSID(shortid);
761
        id = INT_TO_JSID(shortid);
761
    return CallJSPropertyOpSetter(cx, op, obj, id, vp);
762
    return CallJSPropertyOpSetter(cx, op, obj, id, strict, vp);
762
}
763
}
763
764
764
#ifdef JS_TRACER
765
#ifdef JS_TRACER
(-)a/js/src/jscompartment.cpp (+10 lines)
Line     Link Here 
 Lines 338-343   JSCompartment::wrap(JSContext *cx, Prope Link Here 
338
}
338
}
339
339
340
bool
340
bool
341
JSCompartment::wrap(JSContext *cx, StrictPropertyOp *propp)
342
{
343
    Value v = CastAsObjectJsval(*propp);
344
    if (!wrap(cx, &v))
345
        return false;
346
    *propp = CastAsStrictPropertyOp(v.toObjectOrNull());
347
    return true;
348
}
349
350
bool
341
JSCompartment::wrap(JSContext *cx, PropertyDescriptor *desc)
351
JSCompartment::wrap(JSContext *cx, PropertyDescriptor *desc)
342
{
352
{
343
    return wrap(cx, &desc->obj) &&
353
    return wrap(cx, &desc->obj) &&
(-)a/js/src/jscompartment.h (+1 lines)
Line     Link Here 
 Lines 389-394   struct JS_FRIEND_API(JSCompartment) { Link Here 
389
    bool wrap(JSContext *cx, JSObject **objp);
389
    bool wrap(JSContext *cx, JSObject **objp);
390
    bool wrapId(JSContext *cx, jsid *idp);
390
    bool wrapId(JSContext *cx, jsid *idp);
391
    bool wrap(JSContext *cx, js::PropertyOp *op);
391
    bool wrap(JSContext *cx, js::PropertyOp *op);
392
    bool wrap(JSContext *cx, js::StrictPropertyOp *op);
392
    bool wrap(JSContext *cx, js::PropertyDescriptor *desc);
393
    bool wrap(JSContext *cx, js::PropertyDescriptor *desc);
393
    bool wrap(JSContext *cx, js::AutoIdVector &props);
394
    bool wrap(JSContext *cx, js::AutoIdVector &props);
394
395
(-)a/js/src/jsdate.cpp (-5 / +5 lines)
Line     Link Here 
 Lines 493-502   Class js_DateClass = { Link Here 
493
    js_Date_str,
493
    js_Date_str,
494
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::DATE_CLASS_RESERVED_SLOTS) |
494
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::DATE_CLASS_RESERVED_SLOTS) |
495
    JSCLASS_HAS_CACHED_PROTO(JSProto_Date),
495
    JSCLASS_HAS_CACHED_PROTO(JSProto_Date),
496
    PropertyStub,   /* addProperty */
496
    PropertyStub,         /* addProperty */
497
    PropertyStub,   /* delProperty */
497
    PropertyStub,         /* delProperty */
498
    PropertyStub,   /* getProperty */
498
    PropertyStub,         /* getProperty */
499
    PropertyStub,   /* setProperty */
499
    StrictPropertyStub,   /* setProperty */
500
    EnumerateStub,
500
    EnumerateStub,
501
    ResolveStub,
501
    ResolveStub,
502
    ConvertStub
502
    ConvertStub
 Lines 2549-2555   js_InitDateClass(JSContext *cx, JSObject Link Here 
2549
    jsid toGMTStringId = ATOM_TO_JSID(cx->runtime->atomState.toGMTStringAtom);
2549
    jsid toGMTStringId = ATOM_TO_JSID(cx->runtime->atomState.toGMTStringAtom);
2550
    if (!js_GetProperty(cx, proto, toUTCStringId, toUTCStringFun.addr()) ||
2550
    if (!js_GetProperty(cx, proto, toUTCStringId, toUTCStringFun.addr()) ||
2551
        !js_DefineProperty(cx, proto, toGMTStringId, toUTCStringFun.addr(),
2551
        !js_DefineProperty(cx, proto, toGMTStringId, toUTCStringFun.addr(),
2552
                           PropertyStub, PropertyStub, 0)) {
2552
                           PropertyStub, StrictPropertyStub, 0)) {
2553
        return NULL;
2553
        return NULL;
2554
    }
2554
    }
2555
2555
(-)a/js/src/jsdbgapi.cpp (-14 / +20 lines)
Line     Link Here 
 Lines 568-574   struct JSWatchPoint { Link Here 
568
    JSCList             links;
568
    JSCList             links;
569
    JSObject            *object;        /* weak link, see js_FinalizeObject */
569
    JSObject            *object;        /* weak link, see js_FinalizeObject */
570
    const Shape         *shape;
570
    const Shape         *shape;
571
    PropertyOp          setter;
571
    StrictPropertyOp    setter;
572
    JSWatchPointHandler handler;
572
    JSWatchPointHandler handler;
573
    JSObject            *closure;
573
    JSObject            *closure;
574
    uintN               flags;
574
    uintN               flags;
 Lines 701-707   FindWatchPoint(JSRuntime *rt, JSObject * Link Here 
701
}
701
}
702
702
703
JSBool
703
JSBool
704
js_watch_set(JSContext *cx, JSObject *obj, jsid id, Value *vp)
704
js_watch_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
705
{
705
{
706
    JSRuntime *rt = cx->runtime;
706
    JSRuntime *rt = cx->runtime;
707
    DBG_LOCK(rt);
707
    DBG_LOCK(rt);
 Lines 740-746   js_watch_set(JSContext *cx, JSObject *ob Link Here 
740
                         ? ExternalInvoke(cx, obj,
740
                         ? ExternalInvoke(cx, obj,
741
                                          ObjectValue(*CastAsObject(wp->setter)),
741
                                          ObjectValue(*CastAsObject(wp->setter)),
742
                                          1, vp, vp)
742
                                          1, vp, vp)
743
                         : CallJSPropertyOpSetter(cx, wp->setter, obj, userid, vp));
743
                         : CallJSPropertyOpSetter(cx, wp->setter, obj, userid, strict, vp));
744
744
745
            DBG_LOCK(rt);
745
            DBG_LOCK(rt);
746
            return DropWatchPointAndUnlock(cx, wp, JSWP_HELD) && ok;
746
            return DropWatchPointAndUnlock(cx, wp, JSWP_HELD) && ok;
 Lines 762-768   js_watch_set_wrapper(JSContext *cx, uint Link Here 
762
    jsid userid = ATOM_TO_JSID(wrapper->atom);
762
    jsid userid = ATOM_TO_JSID(wrapper->atom);
763
763
764
    JS_SET_RVAL(cx, vp, argc ? JS_ARGV(cx, vp)[0] : UndefinedValue());
764
    JS_SET_RVAL(cx, vp, argc ? JS_ARGV(cx, vp)[0] : UndefinedValue());
765
    return js_watch_set(cx, obj, userid, vp);
765
    /*
766
     * The strictness we pass here doesn't matter, since we know that it's
767
     * a JS setter, which can't depend on the assigning code's strictness.
768
     */
769
    return js_watch_set(cx, obj, userid, false, vp);
766
}
770
}
767
771
768
static bool
772
static bool
 Lines 784-796   IsWatchedProperty(JSContext *cx, const S Link Here 
784
 * with attributes |attrs|, to implement a watchpoint on the property named
788
 * with attributes |attrs|, to implement a watchpoint on the property named
785
 * |id|.
789
 * |id|.
786
 */
790
 */
787
static PropertyOp
791
static StrictPropertyOp
788
WrapWatchedSetter(JSContext *cx, jsid id, uintN attrs, PropertyOp setter)
792
WrapWatchedSetter(JSContext *cx, jsid id, uintN attrs, StrictPropertyOp setter)
789
{
793
{
790
    JSAtom *atom;
794
    JSAtom *atom;
791
    JSFunction *wrapper;
795
    JSFunction *wrapper;
792
796
793
    /* Wrap a JSPropertyOp setter simply by returning our own JSPropertyOp. */
797
    /* Wrap a C++ setter simply by returning our own C++ setter. */
794
    if (!(attrs & JSPROP_SETTER))
798
    if (!(attrs & JSPROP_SETTER))
795
        return &js_watch_set;   /* & to silence schoolmarmish MSVC */
799
        return &js_watch_set;   /* & to silence schoolmarmish MSVC */
796
800
 Lines 812-818   WrapWatchedSetter(JSContext *cx, jsid id Link Here 
812
                             setter ? CastAsObject(setter)->getParent() : NULL, atom);
816
                             setter ? CastAsObject(setter)->getParent() : NULL, atom);
813
    if (!wrapper)
817
    if (!wrapper)
814
        return NULL;
818
        return NULL;
815
    return CastAsPropertyOp(FUN_OBJECT(wrapper));
819
    return CastAsStrictPropertyOp(FUN_OBJECT(wrapper));
816
}
820
}
817
821
818
static bool
822
static bool
 Lines 822-829   UpdateWatchpointShape(JSContext *cx, JSW Link Here 
822
    JS_ASSERT(!IsWatchedProperty(cx, newShape));
826
    JS_ASSERT(!IsWatchedProperty(cx, newShape));
823
827
824
    /* Create a watching setter we can substitute for the new shape's setter. */
828
    /* Create a watching setter we can substitute for the new shape's setter. */
825
    js::PropertyOp watchingSetter = WrapWatchedSetter(cx, newShape->id, newShape->attributes(),
829
    js::StrictPropertyOp watchingSetter = 
826
                                                      newShape->setter());
830
        WrapWatchedSetter(cx, newShape->id, newShape->attributes(), newShape->setter());
827
    if (!watchingSetter)
831
    if (!watchingSetter)
828
        return false;
832
        return false;
829
833
 Lines 831-837   UpdateWatchpointShape(JSContext *cx, JSW Link Here 
831
     * Save the shape's setter; we don't know whether js_ChangeNativePropertyAttrs will
835
     * Save the shape's setter; we don't know whether js_ChangeNativePropertyAttrs will
832
     * return a new shape, or mutate this one.
836
     * return a new shape, or mutate this one.
833
     */
837
     */
834
    js::PropertyOp originalSetter = newShape->setter();
838
    js::StrictPropertyOp originalSetter = newShape->setter();
835
839
836
    /*
840
    /*
837
     * Drop the watching setter into the object, in place of newShape. Note that a single
841
     * Drop the watching setter into the object, in place of newShape. Note that a single
 Lines 878-884   js_SlowPathUpdateWatchpointsForShape(JSC Link Here 
878
 * watchpoint-wrapped shape may correspond to more than one non-watchpoint shape; see the
882
 * watchpoint-wrapped shape may correspond to more than one non-watchpoint shape; see the
879
 * comments in UpdateWatchpointShape.
883
 * comments in UpdateWatchpointShape.
880
 */
884
 */
881
static PropertyOp
885
static StrictPropertyOp
882
UnwrapSetter(JSContext *cx, JSObject *obj, const Shape *shape)
886
UnwrapSetter(JSContext *cx, JSObject *obj, const Shape *shape)
883
{
887
{
884
    /* If it's not a watched property, its setter is not wrapped. */
888
    /* If it's not a watched property, its setter is not wrapped. */
 Lines 954-960   JS_SetWatchPoint(JSContext *cx, JSObject Link Here 
954
    } else if (pobj != obj) {
958
    } else if (pobj != obj) {
955
        /* Clone the prototype property so we can watch the right object. */
959
        /* Clone the prototype property so we can watch the right object. */
956
        AutoValueRooter valroot(cx);
960
        AutoValueRooter valroot(cx);
957
        PropertyOp getter, setter;
961
        PropertyOp getter;
962
        StrictPropertyOp setter;
958
        uintN attrs, flags;
963
        uintN attrs, flags;
959
        intN shortid;
964
        intN shortid;
960
965
 Lines 972-978   JS_SetWatchPoint(JSContext *cx, JSObject Link Here 
972
                !pobj->getAttributes(cx, propid, &attrs)) {
977
                !pobj->getAttributes(cx, propid, &attrs)) {
973
                return JS_FALSE;
978
                return JS_FALSE;
974
            }
979
            }
975
            getter = setter = NULL;
980
            getter = NULL;
981
            setter = NULL;
976
            flags = 0;
982
            flags = 0;
977
            shortid = 0;
983
            shortid = 0;
978
        }
984
        }
(-)a/js/src/jsdbgapi.h (-1 / +1 lines)
Line     Link Here 
 Lines 151-157   js_SweepWatchPoints(JSContext *cx); Link Here 
151
#ifdef __cplusplus
151
#ifdef __cplusplus
152
152
153
extern JSBool
153
extern JSBool
154
js_watch_set(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
154
js_watch_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, js::Value *vp);
155
155
156
#endif
156
#endif
157
157
(-)a/js/src/jsexn.cpp (-10 / +10 lines)
Line     Link Here 
 Lines 91-110   Class js_ErrorClass = { Link Here 
91
    js_Error_str,
91
    js_Error_str,
92
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_MARK_IS_TRACE |
92
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_MARK_IS_TRACE |
93
    JSCLASS_HAS_CACHED_PROTO(JSProto_Error),
93
    JSCLASS_HAS_CACHED_PROTO(JSProto_Error),
94
    PropertyStub,   /* addProperty */
94
    PropertyStub,         /* addProperty */
95
    PropertyStub,   /* delProperty */
95
    PropertyStub,         /* delProperty */
96
    PropertyStub,   /* getProperty */
96
    PropertyStub,         /* getProperty */
97
    PropertyStub,   /* setProperty */
97
    StrictPropertyStub,   /* setProperty */
98
    exn_enumerate,
98
    exn_enumerate,
99
    (JSResolveOp)exn_resolve,
99
    (JSResolveOp)exn_resolve,
100
    ConvertStub,
100
    ConvertStub,
101
    exn_finalize,
101
    exn_finalize,
102
    NULL,           /* reserved0   */
102
    NULL,                 /* reserved0   */
103
    NULL,           /* checkAccess */
103
    NULL,                 /* checkAccess */
104
    NULL,           /* call        */
104
    NULL,                 /* call        */
105
    NULL,           /* construct   */
105
    NULL,                 /* construct   */
106
    NULL,           /* xdrObject   */
106
    NULL,                 /* xdrObject   */
107
    NULL,           /* hasInstance */
107
    NULL,                 /* hasInstance */
108
    JS_CLASS_TRACE(exn_trace)
108
    JS_CLASS_TRACE(exn_trace)
109
};
109
};
110
110
(-)a/js/src/jsfun.cpp (-66 / +72 lines)
Line     Link Here 
 Lines 546-552   ArgGetter(JSContext *cx, JSObject *obj, Link Here 
546
}
546
}
547
547
548
static JSBool
548
static JSBool
549
ArgSetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
549
ArgSetter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
550
{
550
{
551
#ifdef JS_TRACER
551
#ifdef JS_TRACER
552
    // To be able to set a property here on trace, we would have to make
552
    // To be able to set a property here on trace, we would have to make
 Lines 586-592   ArgSetter(JSContext *cx, JSObject *obj, Link Here 
586
     */
586
     */
587
    AutoValueRooter tvr(cx);
587
    AutoValueRooter tvr(cx);
588
    return js_DeleteProperty(cx, obj, id, tvr.addr(), false) &&
588
    return js_DeleteProperty(cx, obj, id, tvr.addr(), false) &&
589
           js_SetProperty(cx, obj, id, vp, false);
589
           js_SetProperty(cx, obj, id, vp, strict);
590
}
590
}
591
591
592
static JSBool
592
static JSBool
 Lines 676-682   StrictArgGetter(JSContext *cx, JSObject Link Here 
676
}
676
}
677
677
678
static JSBool
678
static JSBool
679
StrictArgSetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
679
680
StrictArgSetter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
680
{
681
{
681
    if (!InstanceOf(cx, obj, &StrictArgumentsClass, NULL))
682
    if (!InstanceOf(cx, obj, &StrictArgumentsClass, NULL))
682
        return true;
683
        return true;
 Lines 698-705   StrictArgSetter(JSContext *cx, JSObject Link Here 
698
     * collect its value.
699
     * collect its value.
699
     */
700
     */
700
    AutoValueRooter tvr(cx);
701
    AutoValueRooter tvr(cx);
701
    return js_DeleteProperty(cx, obj, id, tvr.addr(), true) &&
702
    return js_DeleteProperty(cx, obj, id, tvr.addr(), strict) &&
702
           js_SetProperty(cx, obj, id, vp, true);
703
           js_SetProperty(cx, obj, id, vp, strict);
703
}
704
}
704
705
705
static JSBool
706
static JSBool
 Lines 711-717   strictargs_resolve(JSContext *cx, JSObje Link Here 
711
712
712
    uintN attrs = JSPROP_SHARED | JSPROP_SHADOWABLE;
713
    uintN attrs = JSPROP_SHARED | JSPROP_SHADOWABLE;
713
    PropertyOp getter = StrictArgGetter;
714
    PropertyOp getter = StrictArgGetter;
714
    PropertyOp setter = StrictArgSetter;
715
    StrictPropertyOp setter = StrictArgSetter;
715
716
716
    if (JSID_IS_INT(id)) {
717
    if (JSID_IS_INT(id)) {
717
        uint32 arg = uint32(JSID_TO_INT(id));
718
        uint32 arg = uint32(JSID_TO_INT(id));
 Lines 729-735   strictargs_resolve(JSContext *cx, JSObje Link Here 
729
        }
730
        }
730
731
731
        attrs = JSPROP_PERMANENT | JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED;
732
        attrs = JSPROP_PERMANENT | JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED;
732
        getter = setter = CastAsPropertyOp(obj->getThrowTypeError());
733
        getter = CastAsPropertyOp(obj->getThrowTypeError());
734
        setter = CastAsStrictPropertyOp(obj->getThrowTypeError());
733
    }
735
    }
734
736
735
    Value undef = UndefinedValue();
737
    Value undef = UndefinedValue();
 Lines 832-851   Class js_ArgumentsClass = { Link Here 
832
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
834
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
833
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::ARGS_CLASS_RESERVED_SLOTS) |
835
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::ARGS_CLASS_RESERVED_SLOTS) |
834
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
836
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
835
    PropertyStub,   /* addProperty */
837
    PropertyStub,         /* addProperty */
836
    args_delProperty,
838
    args_delProperty,
837
    PropertyStub,   /* getProperty */
839
    PropertyStub,         /* getProperty */
838
    PropertyStub,   /* setProperty */
840
    StrictPropertyStub,   /* setProperty */
839
    args_enumerate,
841
    args_enumerate,
840
    (JSResolveOp) args_resolve,
842
    (JSResolveOp) args_resolve,
841
    ConvertStub,
843
    ConvertStub,
842
    args_finalize,  /* finalize   */
844
    args_finalize,        /* finalize   */
843
    NULL,           /* reserved0   */
845
    NULL,                 /* reserved0   */
844
    NULL,           /* checkAccess */
846
    NULL,                 /* checkAccess */
845
    NULL,           /* call        */
847
    NULL,                 /* call        */
846
    NULL,           /* construct   */
848
    NULL,                 /* construct   */
847
    NULL,           /* xdrObject   */
849
    NULL,                 /* xdrObject   */
848
    NULL,           /* hasInstance */
850
    NULL,                 /* hasInstance */
849
    JS_CLASS_TRACE(args_trace)
851
    JS_CLASS_TRACE(args_trace)
850
};
852
};
851
853
 Lines 861-880   Class StrictArgumentsClass = { Link Here 
861
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
863
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
862
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::ARGS_CLASS_RESERVED_SLOTS) |
864
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::ARGS_CLASS_RESERVED_SLOTS) |
863
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
865
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
864
    PropertyStub,   /* addProperty */
866
    PropertyStub,         /* addProperty */
865
    args_delProperty,
867
    args_delProperty,
866
    PropertyStub,   /* getProperty */
868
    PropertyStub,         /* getProperty */
867
    PropertyStub,   /* setProperty */
869
    StrictPropertyStub,   /* setProperty */
868
    strictargs_enumerate,
870
    strictargs_enumerate,
869
    reinterpret_cast<JSResolveOp>(strictargs_resolve),
871
    reinterpret_cast<JSResolveOp>(strictargs_resolve),
870
    ConvertStub,
872
    ConvertStub,
871
    args_finalize,  /* finalize   */
873
    args_finalize,        /* finalize   */
872
    NULL,           /* reserved0   */
874
    NULL,                 /* reserved0   */
873
    NULL,           /* checkAccess */
875
    NULL,                 /* checkAccess */
874
    NULL,           /* call        */
876
    NULL,                 /* call        */
875
    NULL,           /* construct   */
877
    NULL,                 /* construct   */
876
    NULL,           /* xdrObject   */
878
    NULL,                 /* xdrObject   */
877
    NULL,           /* hasInstance */
879
    NULL,                 /* hasInstance */
878
    JS_CLASS_TRACE(args_trace)
880
    JS_CLASS_TRACE(args_trace)
879
};
881
};
880
882
 Lines 887-896   Class StrictArgumentsClass = { Link Here 
887
Class js_DeclEnvClass = {
889
Class js_DeclEnvClass = {
888
    js_Object_str,
890
    js_Object_str,
889
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
891
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
890
    PropertyStub,   /* addProperty */
892
    PropertyStub,         /* addProperty */
891
    PropertyStub,   /* delProperty */
893
    PropertyStub,         /* delProperty */
892
    PropertyStub,   /* getProperty */
894
    PropertyStub,         /* getProperty */
893
    PropertyStub,   /* setProperty */
895
    StrictPropertyStub,   /* setProperty */
894
    EnumerateStub,
896
    EnumerateStub,
895
    ResolveStub,
897
    ResolveStub,
896
    ConvertStub
898
    ConvertStub
 Lines 1186-1192   GetCallArguments(JSContext *cx, JSObject Link Here 
1186
}
1188
}
1187
1189
1188
static JSBool
1190
static JSBool
1189
SetCallArguments(JSContext *cx, JSObject *obj, jsid id, Value *vp)
1191
SetCallArguments(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
1190
{
1192
{
1191
    if (JSStackFrame *fp = obj->maybeCallObjStackFrame())
1193
    if (JSStackFrame *fp = obj->maybeCallObjStackFrame())
1192
        fp->setOverriddenArgs();
1194
        fp->setOverriddenArgs();
 Lines 1208-1214   GetCallArg(JSContext *cx, JSObject *obj, Link Here 
1208
}
1210
}
1209
1211
1210
JSBool
1212
JSBool
1211
SetCallArg(JSContext *cx, JSObject *obj, jsid id, Value *vp)
1213
SetCallArg(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
1212
{
1214
{
1213
    JS_ASSERT((int16) JSID_TO_INT(id) == JSID_TO_INT(id));
1215
    JS_ASSERT((int16) JSID_TO_INT(id) == JSID_TO_INT(id));
1214
    uintN i = (uint16) JSID_TO_INT(id);
1216
    uintN i = (uint16) JSID_TO_INT(id);
 Lines 1235-1241   GetCallUpvar(JSContext *cx, JSObject *ob Link Here 
1235
}
1237
}
1236
1238
1237
JSBool
1239
JSBool
1238
SetCallUpvar(JSContext *cx, JSObject *obj, jsid id, Value *vp)
1240
SetCallUpvar(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
1239
{
1241
{
1240
    JS_ASSERT((int16) JSID_TO_INT(id) == JSID_TO_INT(id));
1242
    JS_ASSERT((int16) JSID_TO_INT(id) == JSID_TO_INT(id));
1241
    uintN i = (uint16) JSID_TO_INT(id);
1243
    uintN i = (uint16) JSID_TO_INT(id);
 Lines 1271-1277   GetCallVarChecked(JSContext *cx, JSObjec Link Here 
1271
}
1273
}
1272
1274
1273
JSBool
1275
JSBool
1274
SetCallVar(JSContext *cx, JSObject *obj, jsid id, Value *vp)
1276
SetCallVar(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
1275
{
1277
{
1276
    JS_ASSERT(obj->isCall());
1278
    JS_ASSERT(obj->isCall());
1277
1279
 Lines 1309-1315   JSBool JS_FASTCALL Link Here 
1309
js_SetCallArg(JSContext *cx, JSObject *obj, jsid slotid, ValueArgType arg)
1311
js_SetCallArg(JSContext *cx, JSObject *obj, jsid slotid, ValueArgType arg)
1310
{
1312
{
1311
    Value argcopy = ValueArgToConstRef(arg);
1313
    Value argcopy = ValueArgToConstRef(arg);
1312
    return SetCallArg(cx, obj, slotid, &argcopy);
1314
    return SetCallArg(cx, obj, slotid, false /* STRICT DUMMY */, &argcopy);
1313
}
1315
}
1314
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallArg, CONTEXT, OBJECT, JSID, VALUE, 0,
1316
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallArg, CONTEXT, OBJECT, JSID, VALUE, 0,
1315
                     nanojit::ACCSET_STORE_ANY)
1317
                     nanojit::ACCSET_STORE_ANY)
 Lines 1318-1324   JSBool JS_FASTCALL Link Here 
1318
js_SetCallVar(JSContext *cx, JSObject *obj, jsid slotid, ValueArgType arg)
1320
js_SetCallVar(JSContext *cx, JSObject *obj, jsid slotid, ValueArgType arg)
1319
{
1321
{
1320
    Value argcopy = ValueArgToConstRef(arg);
1322
    Value argcopy = ValueArgToConstRef(arg);
1321
    return SetCallVar(cx, obj, slotid, &argcopy);
1323
    return SetCallVar(cx, obj, slotid, false /* STRICT DUMMY */, &argcopy);
1322
}
1324
}
1323
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallVar, CONTEXT, OBJECT, JSID, VALUE, 0,
1325
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallVar, CONTEXT, OBJECT, JSID, VALUE, 0,
1324
                     nanojit::ACCSET_STORE_ANY)
1326
                     nanojit::ACCSET_STORE_ANY)
 Lines 1392-1411   JS_PUBLIC_DATA(Class) js_CallClass = { Link Here 
1392
    JSCLASS_HAS_PRIVATE |
1394
    JSCLASS_HAS_PRIVATE |
1393
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::CALL_RESERVED_SLOTS) |
1395
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::CALL_RESERVED_SLOTS) |
1394
    JSCLASS_NEW_RESOLVE | JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
1396
    JSCLASS_NEW_RESOLVE | JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
1395
    PropertyStub,   /* addProperty */
1397
    PropertyStub,         /* addProperty */
1396
    PropertyStub,   /* delProperty */
1398
    PropertyStub,         /* delProperty */
1397
    PropertyStub,   /* getProperty */
1399
    PropertyStub,         /* getProperty */
1398
    PropertyStub,   /* setProperty */
1400
    StrictPropertyStub,   /* setProperty */
1399
    JS_EnumerateStub,
1401
    JS_EnumerateStub,
1400
    (JSResolveOp)call_resolve,
1402
    (JSResolveOp)call_resolve,
1401
    NULL,           /* convert: Leave it NULL so we notice if calls ever escape */
1403
    NULL,                 /* convert: Leave it NULL so we notice if calls ever escape */
1402
    NULL,           /* finalize */
1404
    NULL,                 /* finalize */
1403
    NULL,           /* reserved0   */
1405
    NULL,                 /* reserved0   */
1404
    NULL,           /* checkAccess */
1406
    NULL,                 /* checkAccess */
1405
    NULL,           /* call        */
1407
    NULL,                 /* call        */
1406
    NULL,           /* construct   */
1408
    NULL,                 /* construct   */
1407
    NULL,           /* xdrObject   */
1409
    NULL,                 /* xdrObject   */
1408
    NULL,           /* hasInstance */
1410
    NULL,                 /* hasInstance */
1409
    JS_CLASS_TRACE(call_trace)
1411
    JS_CLASS_TRACE(call_trace)
1410
};
1412
};
1411
1413
 Lines 1763-1769   fun_resolve(JSContext *cx, JSObject *obj Link Here 
1763
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom)) {
1765
    if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom)) {
1764
        JS_ASSERT(!IsInternalFunctionObject(obj));
1766
        JS_ASSERT(!IsInternalFunctionObject(obj));
1765
        if (!js_DefineNativeProperty(cx, obj, id, Int32Value(fun->nargs),
1767
        if (!js_DefineNativeProperty(cx, obj, id, Int32Value(fun->nargs),
1766
                                     PropertyStub, PropertyStub,
1768
                                     PropertyStub, StrictPropertyStub,
1767
                                     JSPROP_PERMANENT | JSPROP_READONLY, 0, 0, NULL)) {
1769
                                     JSPROP_PERMANENT | JSPROP_READONLY, 0, 0, NULL)) {
1768
            return false;
1770
            return false;
1769
        }
1771
        }
 Lines 1778-1784   fun_resolve(JSContext *cx, JSObject *obj Link Here 
1778
            JS_ASSERT(!IsInternalFunctionObject(obj));
1780
            JS_ASSERT(!IsInternalFunctionObject(obj));
1779
1781
1780
            if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
1782
            if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
1781
                                         fun_getProperty, PropertyStub,
1783
                                         fun_getProperty, StrictPropertyStub,
1782
                                         lfp->attrs, Shape::HAS_SHORTID,
1784
                                         lfp->attrs, Shape::HAS_SHORTID,
1783
                                         lfp->tinyid, NULL)) {
1785
                                         lfp->tinyid, NULL)) {
1784
                return false;
1786
                return false;
 Lines 1794-1810   fun_resolve(JSContext *cx, JSObject *obj Link Here 
1794
        if (JSID_IS_ATOM(id, OFFSET_TO_ATOM(cx->runtime, p.atomOffset))) {
1796
        if (JSID_IS_ATOM(id, OFFSET_TO_ATOM(cx->runtime, p.atomOffset))) {
1795
            JS_ASSERT(!IsInternalFunctionObject(obj));
1797
            JS_ASSERT(!IsInternalFunctionObject(obj));
1796
1798
1797
            PropertyOp getter, setter;
1799
            PropertyOp getter;
1800
            StrictPropertyOp setter;
1798
            uintN attrs = JSPROP_PERMANENT;
1801
            uintN attrs = JSPROP_PERMANENT;
1799
            if (fun->isInterpreted() ? fun->inStrictMode() : obj->isBoundFunction()) {
1802
            if (fun->isInterpreted() ? fun->inStrictMode() : obj->isBoundFunction()) {
1800
                JSObject *throwTypeError = obj->getThrowTypeError();
1803
                JSObject *throwTypeError = obj->getThrowTypeError();
1801
1804
1802
                getter = CastAsPropertyOp(throwTypeError);
1805
                getter = CastAsPropertyOp(throwTypeError);
1803
                setter = CastAsPropertyOp(throwTypeError);
1806
                setter = CastAsStrictPropertyOp(throwTypeError);
1804
                attrs |= JSPROP_GETTER | JSPROP_SETTER;
1807
                attrs |= JSPROP_GETTER | JSPROP_SETTER;
1805
            } else {
1808
            } else {
1806
                getter = fun_getProperty;
1809
                getter = fun_getProperty;
1807
                setter = PropertyStub;
1810
                setter = StrictPropertyStub;
1808
            }
1811
            }
1809
1812
1810
            if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
1813
            if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
 Lines 1991-2008   JS_PUBLIC_DATA(Class) js_FunctionClass = Link Here 
1991
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
1994
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
1992
    JSCLASS_HAS_RESERVED_SLOTS(JSFunction::CLASS_RESERVED_SLOTS) |
1995
    JSCLASS_HAS_RESERVED_SLOTS(JSFunction::CLASS_RESERVED_SLOTS) |
1993
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Function),
1996
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Function),
1994
    PropertyStub,   /* addProperty */
1997
    PropertyStub,         /* addProperty */
1995
    PropertyStub,   /* delProperty */
1998
    PropertyStub,         /* delProperty */
1996
    PropertyStub,   /* getProperty */
1999
    PropertyStub,         /* getProperty */
1997
    PropertyStub,   /* setProperty */
2000
    StrictPropertyStub,   /* setProperty */
1998
    fun_enumerate,
2001
    fun_enumerate,
1999
    (JSResolveOp)fun_resolve,
2002
    (JSResolveOp)fun_resolve,
2000
    ConvertStub,
2003
    ConvertStub,
2001
    fun_finalize,
2004
    fun_finalize,
2002
    NULL,           /* reserved0   */
2005
    NULL,                 /* reserved0   */
2003
    NULL,           /* checkAccess */
2006
    NULL,                 /* checkAccess */
2004
    NULL,           /* call        */
2007
    NULL,                 /* call        */
2005
    NULL,           /* construct   */
2008
    NULL,                 /* construct   */
2006
    js_XDRFunctionObject,
2009
    js_XDRFunctionObject,
2007
    fun_hasInstance,
2010
    fun_hasInstance,
2008
    JS_CLASS_TRACE(fun_trace)
2011
    JS_CLASS_TRACE(fun_trace)
 Lines 2832-2838   JSFunction * Link Here 
2832
js_DefineFunction(JSContext *cx, JSObject *obj, jsid id, Native native,
2835
js_DefineFunction(JSContext *cx, JSObject *obj, jsid id, Native native,
2833
                  uintN nargs, uintN attrs)
2836
                  uintN nargs, uintN attrs)
2834
{
2837
{
2835
    PropertyOp gsop;
2838
    PropertyOp gop;
2839
    StrictPropertyOp sop;
2836
    JSFunction *fun;
2840
    JSFunction *fun;
2837
2841
2838
    if (attrs & JSFUN_STUB_GSOPS) {
2842
    if (attrs & JSFUN_STUB_GSOPS) {
 Lines 2843-2851   js_DefineFunction(JSContext *cx, JSObjec Link Here 
2843
         * for more on this.
2847
         * for more on this.
2844
         */
2848
         */
2845
        attrs &= ~JSFUN_STUB_GSOPS;
2849
        attrs &= ~JSFUN_STUB_GSOPS;
2846
        gsop = PropertyStub;
2850
        gop = PropertyStub;
2851
        sop = StrictPropertyStub;
2847
    } else {
2852
    } else {
2848
        gsop = NULL;
2853
        gop = NULL;
2854
        sop = NULL;
2849
    }
2855
    }
2850
2856
2851
    /*
2857
    /*
 Lines 2900-2906   js_DefineFunction(JSContext *cx, JSObjec Link Here 
2900
    if (!wasDelegate && obj->isDelegate())
2906
    if (!wasDelegate && obj->isDelegate())
2901
        obj->clearDelegate();
2907
        obj->clearDelegate();
2902
2908
2903
    if (!obj->defineProperty(cx, id, ObjectValue(*fun), gsop, gsop, attrs & ~JSFUN_FLAGS_MASK))
2909
    if (!obj->defineProperty(cx, id, ObjectValue(*fun), gop, sop, attrs & ~JSFUN_FLAGS_MASK))
2904
        return NULL;
2910
        return NULL;
2905
    return fun;
2911
    return fun;
2906
}
2912
}
(-)a/js/src/jsfun.h (-3 / +3 lines)
Line     Link Here 
 Lines 529-541   extern JSBool Link Here 
529
GetCallUpvar(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
529
GetCallUpvar(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
530
530
531
extern JSBool
531
extern JSBool
532
SetCallArg(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
532
SetCallArg(JSContext *cx, JSObject *obj, jsid id, JSBool strict, js::Value *vp);
533
533
534
extern JSBool
534
extern JSBool
535
SetCallVar(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
535
SetCallVar(JSContext *cx, JSObject *obj, jsid id, JSBool strict, js::Value *vp);
536
536
537
extern JSBool
537
extern JSBool
538
SetCallUpvar(JSContext *cx, JSObject *obj, jsid id, js::Value *vp);
538
SetCallUpvar(JSContext *cx, JSObject *obj, jsid id, JSBool strict, js::Value *vp);
539
539
540
} // namespace js
540
} // namespace js
541
541
(-)a/js/src/jsinterp.cpp (-17 / +18 lines)
Line     Link Here 
 Lines 536-545   const uint32 JSSLOT_SAVED_ID = 1; Link Here 
536
Class js_NoSuchMethodClass = {
536
Class js_NoSuchMethodClass = {
537
    "NoSuchMethod",
537
    "NoSuchMethod",
538
    JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
538
    JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
539
    PropertyStub,   /* addProperty */
539
    PropertyStub,         /* addProperty */
540
    PropertyStub,   /* delProperty */
540
    PropertyStub,         /* delProperty */
541
    PropertyStub,   /* getProperty */
541
    PropertyStub,         /* getProperty */
542
    PropertyStub,   /* setProperty */
542
    StrictPropertyStub,   /* setProperty */
543
    EnumerateStub,
543
    EnumerateStub,
544
    ResolveStub,
544
    ResolveStub,
545
    ConvertStub,
545
    ConvertStub,
 Lines 3265-3271   END_CASE(JSOP_PICK) Link Here 
3265
        }                                                                     \
3265
        }                                                                     \
3266
    JS_END_MACRO
3266
    JS_END_MACRO
3267
3267
3268
#define NATIVE_SET(cx,obj,shape,entry,vp)                                     \
3268
#define NATIVE_SET(cx,obj,shape,entry,strict,vp)                              \
3269
    JS_BEGIN_MACRO                                                            \
3269
    JS_BEGIN_MACRO                                                            \
3270
        if (shape->hasDefaultSetter() &&                                      \
3270
        if (shape->hasDefaultSetter() &&                                      \
3271
            (shape)->slot != SHAPE_INVALID_SLOT &&                            \
3271
            (shape)->slot != SHAPE_INVALID_SLOT &&                            \
 Lines 3273-3279   END_CASE(JSOP_PICK) Link Here 
3273
            /* Fast path for, e.g., plain Object instance properties. */      \
3273
            /* Fast path for, e.g., plain Object instance properties. */      \
3274
            (obj)->nativeSetSlot((shape)->slot, *vp);                         \
3274
            (obj)->nativeSetSlot((shape)->slot, *vp);                         \
3275
        } else {                                                              \
3275
        } else {                                                              \
3276
            if (!js_NativeSet(cx, obj, shape, false, vp))                     \
3276
            if (!js_NativeSet(cx, obj, shape, false, strict, vp))             \
3277
                goto error;                                                   \
3277
                goto error;                                                   \
3278
        }                                                                     \
3278
        }                                                                     \
3279
    JS_END_MACRO
3279
    JS_END_MACRO
 Lines 3317-3323   BEGIN_CASE(JSOP_SETCONST) Link Here 
3317
    JSObject &obj = regs.fp->varobj(cx);
3317
    JSObject &obj = regs.fp->varobj(cx);
3318
    const Value &ref = regs.sp[-1];
3318
    const Value &ref = regs.sp[-1];
3319
    if (!obj.defineProperty(cx, ATOM_TO_JSID(atom), ref,
3319
    if (!obj.defineProperty(cx, ATOM_TO_JSID(atom), ref,
3320
                            PropertyStub, PropertyStub,
3320
                            PropertyStub, StrictPropertyStub,
3321
                            JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
3321
                            JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
3322
        goto error;
3322
        goto error;
3323
    }
3323
    }
 Lines 3333-3339   BEGIN_CASE(JSOP_ENUMCONSTELEM) Link Here 
3333
    jsid id;
3333
    jsid id;
3334
    FETCH_ELEMENT_ID(obj, -1, id);
3334
    FETCH_ELEMENT_ID(obj, -1, id);
3335
    if (!obj->defineProperty(cx, id, ref,
3335
    if (!obj->defineProperty(cx, id, ref,
3336
                             PropertyStub, PropertyStub,
3336
                             PropertyStub, StrictPropertyStub,
3337
                             JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
3337
                             JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
3338
        goto error;
3338
        goto error;
3339
    }
3339
    }
 Lines 4408-4414   BEGIN_CASE(JSOP_SETMETHOD) Link Here 
4408
4408
4409
                    PCMETER(cache->pchits++);
4409
                    PCMETER(cache->pchits++);
4410
                    PCMETER(cache->setpchits++);
4410
                    PCMETER(cache->setpchits++);
4411
                    NATIVE_SET(cx, obj, shape, entry, &rval);
4411
                    NATIVE_SET(cx, obj, shape, entry, script->strictModeCode, &rval);
4412
                    break;
4412
                    break;
4413
                }
4413
                }
4414
            } else {
4414
            } else {
 Lines 5371-5378   BEGIN_CASE(JSOP_DEFVAR) Link Here 
5371
5371
5372
    /* Bind a variable only if it's not yet defined. */
5372
    /* Bind a variable only if it's not yet defined. */
5373
    if (!prop) {
5373
    if (!prop) {
5374
        if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(), PropertyStub, PropertyStub,
5374
        if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
5375
                                     attrs, 0, 0, &prop)) {
5375
                                     PropertyStub, StrictPropertyStub, attrs, 0, 0, &prop)) {
5376
            goto error;
5376
            goto error;
5377
        }
5377
        }
5378
        JS_ASSERT(prop);
5378
        JS_ASSERT(prop);
 Lines 5452-5458   BEGIN_CASE(JSOP_DEFFUN) Link Here 
5452
    do {
5452
    do {
5453
        /* Steps 5d, 5f. */
5453
        /* Steps 5d, 5f. */
5454
        if (!prop || pobj != parent) {
5454
        if (!prop || pobj != parent) {
5455
            if (!parent->defineProperty(cx, id, rval, PropertyStub, PropertyStub, attrs))
5455
            if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
5456
                goto error;
5456
                goto error;
5457
            break;
5457
            break;
5458
        }
5458
        }
 Lines 5462-5468   BEGIN_CASE(JSOP_DEFFUN) Link Here 
5462
        Shape *shape = reinterpret_cast<Shape *>(prop);
5462
        Shape *shape = reinterpret_cast<Shape *>(prop);
5463
        if (parent->isGlobal()) {
5463
        if (parent->isGlobal()) {
5464
            if (shape->configurable()) {
5464
            if (shape->configurable()) {
5465
                if (!parent->defineProperty(cx, id, rval, PropertyStub, PropertyStub, attrs))
5465
                if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
5466
                    goto error;
5466
                    goto error;
5467
                break;
5467
                break;
5468
            }
5468
            }
 Lines 5517-5523   BEGIN_CASE(JSOP_DEFFUN_DBGFC) Link Here 
5517
5517
5518
    if ((attrs == JSPROP_ENUMERATE)
5518
    if ((attrs == JSPROP_ENUMERATE)
5519
        ? !parent.setProperty(cx, id, &rval, script->strictModeCode)
5519
        ? !parent.setProperty(cx, id, &rval, script->strictModeCode)
5520
        : !parent.defineProperty(cx, id, rval, PropertyStub, PropertyStub, attrs)) {
5520
        : !parent.defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs)) {
5521
        goto error;
5521
        goto error;
5522
    }
5522
    }
5523
}
5523
}
 Lines 5838-5851   BEGIN_CASE(JSOP_SETTER) Link Here 
5838
    if (!CheckAccess(cx, obj, id, JSACC_WATCH, &rtmp, &attrs))
5838
    if (!CheckAccess(cx, obj, id, JSACC_WATCH, &rtmp, &attrs))
5839
        goto error;
5839
        goto error;
5840
5840
5841
    PropertyOp getter, setter;
5841
    PropertyOp getter;
5842
    StrictPropertyOp setter;
5842
    if (op == JSOP_GETTER) {
5843
    if (op == JSOP_GETTER) {
5843
        getter = CastAsPropertyOp(&rval.toObject());
5844
        getter = CastAsPropertyOp(&rval.toObject());
5844
        setter = PropertyStub;
5845
        setter = StrictPropertyStub;
5845
        attrs = JSPROP_GETTER;
5846
        attrs = JSPROP_GETTER;
5846
    } else {
5847
    } else {
5847
        getter = PropertyStub;
5848
        getter = PropertyStub;
5848
        setter = CastAsPropertyOp(&rval.toObject());
5849
        setter = CastAsStrictPropertyOp(&rval.toObject());
5849
        attrs = JSPROP_SETTER;
5850
        attrs = JSPROP_SETTER;
5850
    }
5851
    }
5851
    attrs |= JSPROP_ENUMERATE | JSPROP_SHARED;
5852
    attrs |= JSPROP_ENUMERATE | JSPROP_SHARED;
(-)a/js/src/jsiter.cpp (-38 / +38 lines)
Line     Link Here 
 Lines 91-117   Class js_IteratorClass = { Link Here 
91
    "Iterator",
91
    "Iterator",
92
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator) |
92
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator) |
93
    JSCLASS_MARK_IS_TRACE,
93
    JSCLASS_MARK_IS_TRACE,
94
    PropertyStub,   /* addProperty */
94
    PropertyStub,         /* addProperty */
95
    PropertyStub,   /* delProperty */
95
    PropertyStub,         /* delProperty */
96
    PropertyStub,   /* getProperty */
96
    PropertyStub,         /* getProperty */
97
    PropertyStub,   /* setProperty */
97
    StrictPropertyStub,   /* setProperty */
98
    EnumerateStub,
98
    EnumerateStub,
99
    ResolveStub,
99
    ResolveStub,
100
    ConvertStub,
100
    ConvertStub,
101
    iterator_finalize,
101
    iterator_finalize,
102
    NULL,           /* reserved    */
102
    NULL,                 /* reserved    */
103
    NULL,           /* checkAccess */
103
    NULL,                 /* checkAccess */
104
    NULL,           /* call        */
104
    NULL,                 /* call        */
105
    NULL,           /* construct   */
105
    NULL,                 /* construct   */
106
    NULL,           /* xdrObject   */
106
    NULL,                 /* xdrObject   */
107
    NULL,           /* hasInstance */
107
    NULL,                 /* hasInstance */
108
    JS_CLASS_TRACE(iterator_trace),
108
    JS_CLASS_TRACE(iterator_trace),
109
    {
109
    {
110
        NULL,       /* equality       */
110
        NULL,             /* equality       */
111
        NULL,       /* outerObject    */
111
        NULL,             /* outerObject    */
112
        NULL,       /* innerObject    */
112
        NULL,             /* innerObject    */
113
        iterator_iterator,
113
        iterator_iterator,
114
        NULL        /* unused */
114
        NULL              /* unused  */
115
    }
115
    }
116
};
116
};
117
117
 Lines 1026-1044   Class js_StopIterationClass = { Link Here 
1026
    js_StopIteration_str,
1026
    js_StopIteration_str,
1027
    JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration) |
1027
    JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration) |
1028
    JSCLASS_FREEZE_PROTO,
1028
    JSCLASS_FREEZE_PROTO,
1029
    PropertyStub,   /* addProperty */
1029
    PropertyStub,         /* addProperty */
1030
    PropertyStub,   /* delProperty */
1030
    PropertyStub,         /* delProperty */
1031
    PropertyStub,   /* getProperty */
1031
    PropertyStub,         /* getProperty */
1032
    PropertyStub,   /* setProperty */
1032
    StrictPropertyStub,   /* setProperty */
1033
    EnumerateStub,
1033
    EnumerateStub,
1034
    ResolveStub,
1034
    ResolveStub,
1035
    ConvertStub,
1035
    ConvertStub,
1036
    NULL,           /* finalize    */
1036
    NULL,                 /* finalize    */
1037
    NULL,           /* reserved0   */
1037
    NULL,                 /* reserved0   */
1038
    NULL,           /* checkAccess */
1038
    NULL,                 /* checkAccess */
1039
    NULL,           /* call        */
1039
    NULL,                 /* call        */
1040
    NULL,           /* construct   */
1040
    NULL,                 /* construct   */
1041
    NULL,           /* xdrObject   */
1041
    NULL,                 /* xdrObject   */
1042
    stopiter_hasInstance
1042
    stopiter_hasInstance
1043
};
1043
};
1044
1044
 Lines 1086-1112   Class js_GeneratorClass = { Link Here 
1086
    js_Generator_str,
1086
    js_Generator_str,
1087
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Generator) |
1087
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Generator) |
1088
    JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
1088
    JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
1089
    PropertyStub,   /* addProperty */
1089
    PropertyStub,         /* addProperty */
1090
    PropertyStub,   /* delProperty */
1090
    PropertyStub,         /* delProperty */
1091
    PropertyStub,   /* getProperty */
1091
    PropertyStub,         /* getProperty */
1092
    PropertyStub,   /* setProperty */
1092
    StrictPropertyStub,   /* setProperty */
1093
    EnumerateStub,
1093
    EnumerateStub,
1094
    ResolveStub,
1094
    ResolveStub,
1095
    ConvertStub,
1095
    ConvertStub,
1096
    generator_finalize,
1096
    generator_finalize,
1097
    NULL,           /* reserved    */
1097
    NULL,                 /* reserved    */
1098
    NULL,           /* checkAccess */
1098
    NULL,                 /* checkAccess */
1099
    NULL,           /* call        */
1099
    NULL,                 /* call        */
1100
    NULL,           /* construct   */
1100
    NULL,                 /* construct   */
1101
    NULL,           /* xdrObject   */
1101
    NULL,                 /* xdrObject   */
1102
    NULL,           /* hasInstance */
1102
    NULL,                 /* hasInstance */
1103
    JS_CLASS_TRACE(generator_trace),
1103
    JS_CLASS_TRACE(generator_trace),
1104
    {
1104
    {
1105
        NULL,       /* equality       */
1105
        NULL,             /* equality       */
1106
        NULL,       /* outerObject    */
1106
        NULL,             /* outerObject    */
1107
        NULL,       /* innerObject    */
1107
        NULL,             /* innerObject    */
1108
        iterator_iterator,
1108
        iterator_iterator,
1109
        NULL        /* unused */
1109
        NULL              /* unused */
1110
    }
1110
    }
1111
};
1111
};
1112
1112
(-)a/js/src/jsmath.cpp (-5 / +5 lines)
Line     Link Here 
 Lines 107-116   MathCache::MathCache() { Link Here 
107
Class js_MathClass = {
107
Class js_MathClass = {
108
    js_Math_str,
108
    js_Math_str,
109
    JSCLASS_HAS_CACHED_PROTO(JSProto_Math),
109
    JSCLASS_HAS_CACHED_PROTO(JSProto_Math),
110
    PropertyStub,   /* addProperty */
110
    PropertyStub,         /* addProperty */
111
    PropertyStub,   /* delProperty */
111
    PropertyStub,         /* delProperty */
112
    PropertyStub,   /* getProperty */
112
    PropertyStub,         /* getProperty */
113
    PropertyStub,   /* setProperty */
113
    StrictPropertyStub,   /* setProperty */
114
    EnumerateStub,
114
    EnumerateStub,
115
    ResolveStub,
115
    ResolveStub,
116
    ConvertStub
116
    ConvertStub
 Lines 873-879   js_InitMathClass(JSContext *cx, JSObject Link Here 
873
    if (!Math)
873
    if (!Math)
874
        return NULL;
874
        return NULL;
875
    if (!JS_DefineProperty(cx, obj, js_Math_str, OBJECT_TO_JSVAL(Math),
875
    if (!JS_DefineProperty(cx, obj, js_Math_str, OBJECT_TO_JSVAL(Math),
876
                           JS_PropertyStub, JS_PropertyStub, 0)) {
876
                           JS_PropertyStub, JS_StrictPropertyStub, 0)) {
877
        return NULL;
877
        return NULL;
878
    }
878
    }
879
879
(-)a/js/src/jsnum.cpp (-6 / +6 lines)
Line     Link Here 
 Lines 526-535   static JSFunctionSpec number_functions[] Link Here 
526
Class js_NumberClass = {
526
Class js_NumberClass = {
527
    js_Number_str,
527
    js_Number_str,
528
    JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number),
528
    JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number),
529
    PropertyStub,   /* addProperty */
529
    PropertyStub,         /* addProperty */
530
    PropertyStub,   /* delProperty */
530
    PropertyStub,         /* delProperty */
531
    PropertyStub,   /* getProperty */
531
    PropertyStub,         /* getProperty */
532
    PropertyStub,   /* setProperty */
532
    StrictPropertyStub,   /* setProperty */
533
    EnumerateStub,
533
    EnumerateStub,
534
    ResolveStub,
534
    ResolveStub,
535
    ConvertStub
535
    ConvertStub
 Lines 1085-1098   js_InitNumberClass(JSContext *cx, JSObje Link Here 
1085
    /* ECMA 15.1.1.1 */
1085
    /* ECMA 15.1.1.1 */
1086
    rt = cx->runtime;
1086
    rt = cx->runtime;
1087
    if (!JS_DefineProperty(cx, obj, js_NaN_str, Jsvalify(rt->NaNValue),
1087
    if (!JS_DefineProperty(cx, obj, js_NaN_str, Jsvalify(rt->NaNValue),
1088
                           JS_PropertyStub, JS_PropertyStub,
1088
                           JS_PropertyStub, JS_StrictPropertyStub,
1089
                           JSPROP_PERMANENT | JSPROP_READONLY)) {
1089
                           JSPROP_PERMANENT | JSPROP_READONLY)) {
1090
        return NULL;
1090
        return NULL;
1091
    }
1091
    }
1092
1092
1093
    /* ECMA 15.1.1.2 */
1093
    /* ECMA 15.1.1.2 */
1094
    if (!JS_DefineProperty(cx, obj, js_Infinity_str, Jsvalify(rt->positiveInfinityValue),
1094
    if (!JS_DefineProperty(cx, obj, js_Infinity_str, Jsvalify(rt->positiveInfinityValue),
1095
                           JS_PropertyStub, JS_PropertyStub,
1095
                           JS_PropertyStub, JS_StrictPropertyStub,
1096
                           JSPROP_PERMANENT | JSPROP_READONLY)) {
1096
                           JSPROP_PERMANENT | JSPROP_READONLY)) {
1097
        return NULL;
1097
        return NULL;
1098
    }
1098
    }
(-)a/js/src/jsobj.cpp (-56 / +60 lines)
Line     Link Here 
 Lines 111-120   JS_FRIEND_DATA(const JSObjectMap) JSObje Link Here 
111
Class js_ObjectClass = {
111
Class js_ObjectClass = {
112
    js_Object_str,
112
    js_Object_str,
113
    JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
113
    JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
114
    PropertyStub,   /* addProperty */
114
    PropertyStub,         /* addProperty */
115
    PropertyStub,   /* delProperty */
115
    PropertyStub,         /* delProperty */
116
    PropertyStub,   /* getProperty */
116
    PropertyStub,         /* getProperty */
117
    PropertyStub,   /* setProperty */
117
    StrictPropertyStub,   /* setProperty */
118
    EnumerateStub,
118
    EnumerateStub,
119
    ResolveStub,
119
    ResolveStub,
120
    ConvertStub
120
    ConvertStub
 Lines 133-139   static JSBool Link Here 
133
obj_getProto(JSContext *cx, JSObject *obj, jsid id, Value *vp);
133
obj_getProto(JSContext *cx, JSObject *obj, jsid id, Value *vp);
134
134
135
static JSBool
135
static JSBool
136
obj_setProto(JSContext *cx, JSObject *obj, jsid id, Value *vp);
136
obj_setProto(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp);
137
137
138
static JSPropertySpec object_props[] = {
138
static JSPropertySpec object_props[] = {
139
    {js_proto_str, 0, JSPROP_PERMANENT|JSPROP_SHARED, Jsvalify(obj_getProto), Jsvalify(obj_setProto)},
139
    {js_proto_str, 0, JSPROP_PERMANENT|JSPROP_SHARED, Jsvalify(obj_getProto), Jsvalify(obj_setProto)},
 Lines 150-156   obj_getProto(JSContext *cx, JSObject *ob Link Here 
150
}
150
}
151
151
152
static JSBool
152
static JSBool
153
obj_setProto(JSContext *cx, JSObject *obj, jsid id, Value *vp)
153
obj_setProto(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
154
{
154
{
155
    /* ECMAScript 5 8.6.2 forbids changing [[Prototype]] if not [[Extensible]]. */
155
    /* ECMAScript 5 8.6.2 forbids changing [[Prototype]] if not [[Extensible]]. */
156
    if (!obj->isExtensible()) {
156
    if (!obj->isExtensible()) {
 Lines 1583-1589   js_obj_defineGetter(JSContext *cx, uintN Link Here 
1583
    if (!CheckAccess(cx, obj, id, JSACC_WATCH, &junk, &attrs))
1583
    if (!CheckAccess(cx, obj, id, JSACC_WATCH, &junk, &attrs))
1584
        return JS_FALSE;
1584
        return JS_FALSE;
1585
    vp->setUndefined();
1585
    vp->setUndefined();
1586
    return obj->defineProperty(cx, id, UndefinedValue(), getter, PropertyStub,
1586
    return obj->defineProperty(cx, id, UndefinedValue(), getter, StrictPropertyStub,
1587
                               JSPROP_ENUMERATE | JSPROP_GETTER | JSPROP_SHARED);
1587
                               JSPROP_ENUMERATE | JSPROP_GETTER | JSPROP_SHARED);
1588
}
1588
}
1589
1589
 Lines 1596-1602   js_obj_defineSetter(JSContext *cx, uintN Link Here 
1596
                             js_setter_str);
1596
                             js_setter_str);
1597
        return JS_FALSE;
1597
        return JS_FALSE;
1598
    }
1598
    }
1599
    PropertyOp setter = CastAsPropertyOp(&vp[3].toObject());
1599
    StrictPropertyOp setter = CastAsStrictPropertyOp(&vp[3].toObject());
1600
1600
1601
    jsid id;
1601
    jsid id;
1602
    if (!ValueToId(cx, vp[2], &id))
1602
    if (!ValueToId(cx, vp[2], &id))
 Lines 1700-1726   js_NewPropertyDescriptorObject(JSContext Link Here 
1700
    const JSAtomState &atomState = cx->runtime->atomState;
1700
    const JSAtomState &atomState = cx->runtime->atomState;
1701
    if (attrs & (JSPROP_GETTER | JSPROP_SETTER)) {
1701
    if (attrs & (JSPROP_GETTER | JSPROP_SETTER)) {
1702
        if (!desc->defineProperty(cx, ATOM_TO_JSID(atomState.getAtom), getter,
1702
        if (!desc->defineProperty(cx, ATOM_TO_JSID(atomState.getAtom), getter,
1703
                                  PropertyStub, PropertyStub, JSPROP_ENUMERATE) ||
1703
                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE) ||
1704
            !desc->defineProperty(cx, ATOM_TO_JSID(atomState.setAtom), setter,
1704
            !desc->defineProperty(cx, ATOM_TO_JSID(atomState.setAtom), setter,
1705
                                  PropertyStub, PropertyStub, JSPROP_ENUMERATE)) {
1705
                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) {
1706
            return false;
1706
            return false;
1707
        }
1707
        }
1708
    } else {
1708
    } else {
1709
        if (!desc->defineProperty(cx, ATOM_TO_JSID(atomState.valueAtom), value,
1709
        if (!desc->defineProperty(cx, ATOM_TO_JSID(atomState.valueAtom), value,
1710
                                  PropertyStub, PropertyStub, JSPROP_ENUMERATE) ||
1710
                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE) ||
1711
            !desc->defineProperty(cx, ATOM_TO_JSID(atomState.writableAtom),
1711
            !desc->defineProperty(cx, ATOM_TO_JSID(atomState.writableAtom),
1712
                                  BooleanValue((attrs & JSPROP_READONLY) == 0),
1712
                                  BooleanValue((attrs & JSPROP_READONLY) == 0),
1713
                                  PropertyStub, PropertyStub, JSPROP_ENUMERATE)) {
1713
                                  PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE)) {
1714
            return false;
1714
            return false;
1715
        }
1715
        }
1716
    }
1716
    }
1717
1717
1718
    return desc->defineProperty(cx, ATOM_TO_JSID(atomState.enumerableAtom),
1718
    return desc->defineProperty(cx, ATOM_TO_JSID(atomState.enumerableAtom),
1719
                                BooleanValue((attrs & JSPROP_ENUMERATE) != 0),
1719
                                BooleanValue((attrs & JSPROP_ENUMERATE) != 0),
1720
                                PropertyStub, PropertyStub, JSPROP_ENUMERATE) &&
1720
                                PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE) &&
1721
           desc->defineProperty(cx, ATOM_TO_JSID(atomState.configurableAtom),
1721
           desc->defineProperty(cx, ATOM_TO_JSID(atomState.configurableAtom),
1722
                                BooleanValue((attrs & JSPROP_PERMANENT) == 0),
1722
                                BooleanValue((attrs & JSPROP_PERMANENT) == 0),
1723
                                PropertyStub, PropertyStub, JSPROP_ENUMERATE);
1723
                                PropertyStub, StrictPropertyStub, JSPROP_ENUMERATE);
1724
}
1724
}
1725
1725
1726
JSBool
1726
JSBool
 Lines 2049-2055   DefinePropertyOnObject(JSContext *cx, JS Link Here 
2049
        if (desc.isGenericDescriptor() || desc.isDataDescriptor()) {
2049
        if (desc.isGenericDescriptor() || desc.isDataDescriptor()) {
2050
            JS_ASSERT(!obj->getOps()->defineProperty);
2050
            JS_ASSERT(!obj->getOps()->defineProperty);
2051
            return js_DefineProperty(cx, obj, desc.id, &desc.value,
2051
            return js_DefineProperty(cx, obj, desc.id, &desc.value,
2052
                                     PropertyStub, PropertyStub, desc.attrs);
2052
                                     PropertyStub, StrictPropertyStub, desc.attrs);
2053
        }
2053
        }
2054
2054
2055
        JS_ASSERT(desc.isAccessorDescriptor());
2055
        JS_ASSERT(desc.isAccessorDescriptor());
 Lines 2238-2244   DefinePropertyOnObject(JSContext *cx, JS Link Here 
2238
2238
2239
    /* 8.12.9 step 12. */
2239
    /* 8.12.9 step 12. */
2240
    uintN attrs;
2240
    uintN attrs;
2241
    PropertyOp getter, setter;
2241
    PropertyOp getter;
2242
    StrictPropertyOp setter;
2242
    if (desc.isGenericDescriptor()) {
2243
    if (desc.isGenericDescriptor()) {
2243
        uintN changed = 0;
2244
        uintN changed = 0;
2244
        if (desc.hasConfigurable)
2245
        if (desc.hasConfigurable)
 Lines 2249-2255   DefinePropertyOnObject(JSContext *cx, JS Link Here 
2249
        attrs = (shape->attributes() & ~changed) | (desc.attrs & changed);
2250
        attrs = (shape->attributes() & ~changed) | (desc.attrs & changed);
2250
        if (shape->isMethod()) {
2251
        if (shape->isMethod()) {
2251
            JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
2252
            JS_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
2252
            getter = setter = PropertyStub;
2253
            getter = PropertyStub;
2254
            setter = StrictPropertyStub;
2253
        } else {
2255
        } else {
2254
            getter = shape->getter();
2256
            getter = shape->getter();
2255
            setter = shape->setter();
2257
            setter = shape->setter();
 Lines 2266-2272   DefinePropertyOnObject(JSContext *cx, JS Link Here 
2266
        if (desc.hasValue)
2268
        if (desc.hasValue)
2267
            v = desc.value;
2269
            v = desc.value;
2268
        attrs = (desc.attrs & ~unchanged) | (shape->attributes() & unchanged);
2270
        attrs = (desc.attrs & ~unchanged) | (shape->attributes() & unchanged);
2269
        getter = setter = PropertyStub;
2271
        getter = PropertyStub;
2272
        setter = StrictPropertyStub;
2270
    } else {
2273
    } else {
2271
        JS_ASSERT(desc.isAccessorDescriptor());
2274
        JS_ASSERT(desc.isAccessorDescriptor());
2272
2275
 Lines 2303-2309   DefinePropertyOnObject(JSContext *cx, JS Link Here 
2303
            setter = desc.setter();
2306
            setter = desc.setter();
2304
        } else {
2307
        } else {
2305
            setter = (shape->hasDefaultSetter() && !shape->hasSetterValue())
2308
            setter = (shape->hasDefaultSetter() && !shape->hasSetterValue())
2306
                     ? PropertyStub
2309
                     ? StrictPropertyStub
2307
                     : shape->setter();
2310
                     : shape->setter();
2308
        }
2311
        }
2309
    }
2312
    }
 Lines 3168-3192   with_ThisObject(JSContext *cx, JSObject Link Here 
3168
Class js_WithClass = {
3171
Class js_WithClass = {
3169
    "With",
3172
    "With",
3170
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
3173
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
3171
    PropertyStub,   /* addProperty */
3174
    PropertyStub,         /* addProperty */
3172
    PropertyStub,   /* delProperty */
3175
    PropertyStub,         /* delProperty */
3173
    PropertyStub,   /* getProperty */
3176
    PropertyStub,         /* getProperty */
3174
    PropertyStub,   /* setProperty */
3177
    StrictPropertyStub,   /* setProperty */
3175
    EnumerateStub,
3178
    EnumerateStub,
3176
    ResolveStub,
3179
    ResolveStub,
3177
    ConvertStub,
3180
    ConvertStub,
3178
    NULL,           /* finalize */
3181
    NULL,                 /* finalize */
3179
    NULL,           /* reserved    */
3182
    NULL,                 /* reserved    */
3180
    NULL,           /* checkAccess */
3183
    NULL,                 /* checkAccess */
3181
    NULL,           /* call        */
3184
    NULL,                 /* call        */
3182
    NULL,           /* construct   */
3185
    NULL,                 /* construct   */
3183
    NULL,           /* xdrObject   */
3186
    NULL,                 /* xdrObject   */
3184
    NULL,           /* hasInstance */
3187
    NULL,                 /* hasInstance */
3185
    NULL,           /* mark        */
3188
    NULL,                 /* mark        */
3186
    JS_NULL_CLASS_EXT,
3189
    JS_NULL_CLASS_EXT,
3187
    {
3190
    {
3188
        with_LookupProperty,
3191
        with_LookupProperty,
3189
        NULL,       /* defineProperty */
3192
        NULL,             /* defineProperty */
3190
        with_GetProperty,
3193
        with_GetProperty,
3191
        with_SetProperty,
3194
        with_SetProperty,
3192
        with_GetAttributes,
3195
        with_GetAttributes,
 Lines 3194-3203   Class js_WithClass = { Link Here 
3194
        with_DeleteProperty,
3197
        with_DeleteProperty,
3195
        with_Enumerate,
3198
        with_Enumerate,
3196
        with_TypeOf,
3199
        with_TypeOf,
3197
        NULL,       /* trace */
3200
        NULL,             /* trace */
3198
        NULL,       /* fix   */
3201
        NULL,             /* fix   */
3199
        with_ThisObject,
3202
        with_ThisObject,
3200
        NULL,       /* clear */
3203
        NULL,             /* clear */
3201
    }
3204
    }
3202
};
3205
};
3203
3206
 Lines 3329-3335   block_getProperty(JSContext *cx, JSObjec Link Here 
3329
}
3332
}
3330
3333
3331
static JSBool
3334
static JSBool
3332
block_setProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp)
3335
block_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
3333
{
3336
{
3334
    JS_ASSERT(obj->isClonedBlock());
3337
    JS_ASSERT(obj->isClonedBlock());
3335
    uintN index = (uintN) JSID_TO_INT(id);
3338
    uintN index = (uintN) JSID_TO_INT(id);
 Lines 3398-3404   JSObject::copyPropertiesFrom(JSContext * Link Here 
3398
        PropertyOp getter = shape->getter();
3401
        PropertyOp getter = shape->getter();
3399
        if ((attrs & JSPROP_GETTER) && !cx->compartment->wrap(cx, &getter))
3402
        if ((attrs & JSPROP_GETTER) && !cx->compartment->wrap(cx, &getter))
3400
            return false;
3403
            return false;
3401
        PropertyOp setter = shape->setter();
3404
        StrictPropertyOp setter = shape->setter();
3402
        if ((attrs & JSPROP_SETTER) && !cx->compartment->wrap(cx, &setter))
3405
        if ((attrs & JSPROP_SETTER) && !cx->compartment->wrap(cx, &setter))
3403
            return false;
3406
            return false;
3404
        Value v = shape->hasSlot() ? obj->getSlot(shape->slot) : UndefinedValue();
3407
        Value v = shape->hasSlot() ? obj->getSlot(shape->slot) : UndefinedValue();
 Lines 3720-3729   js_XDRBlockObject(JSXDRState *xdr, JSObj Link Here 
3720
Class js_BlockClass = {
3723
Class js_BlockClass = {
3721
    "Block",
3724
    "Block",
3722
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_IS_ANONYMOUS,
3725
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_IS_ANONYMOUS,
3723
    PropertyStub,   /* addProperty */
3726
    PropertyStub,         /* addProperty */
3724
    PropertyStub,   /* delProperty */
3727
    PropertyStub,         /* delProperty */
3725
    PropertyStub,   /* getProperty */
3728
    PropertyStub,         /* getProperty */
3726
    PropertyStub,   /* setProperty */
3729
    StrictPropertyStub,   /* setProperty */
3727
    EnumerateStub,
3730
    EnumerateStub,
3728
    ResolveStub,
3731
    ResolveStub,
3729
    ConvertStub
3732
    ConvertStub
 Lines 3768-3774   DefineStandardSlot(JSContext *cx, JSObje Link Here 
3768
            uint32 slot = 2 * JSProto_LIMIT + key;
3771
            uint32 slot = 2 * JSProto_LIMIT + key;
3769
            if (!js_SetReservedSlot(cx, obj, slot, v))
3772
            if (!js_SetReservedSlot(cx, obj, slot, v))
3770
                return false;
3773
                return false;
3771
            if (!obj->addProperty(cx, id, PropertyStub, PropertyStub, slot, attrs, 0, 0))
3774
            if (!obj->addProperty(cx, id, PropertyStub, StrictPropertyStub, slot, attrs, 0, 0))
3772
                return false;
3775
                return false;
3773
3776
3774
            named = true;
3777
            named = true;
 Lines 3776-3782   DefineStandardSlot(JSContext *cx, JSObje Link Here 
3776
        }
3779
        }
3777
    }
3780
    }
3778
3781
3779
    named = obj->defineProperty(cx, id, v, PropertyStub, PropertyStub, attrs);
3782
    named = obj->defineProperty(cx, id, v, PropertyStub, StrictPropertyStub, attrs);
3780
    return named;
3783
    return named;
3781
}
3784
}
3782
3785
 Lines 4520-4526   js_PurgeScopeChainHelper(JSContext *cx, Link Here 
4520
4523
4521
const Shape *
4524
const Shape *
4522
js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
4525
js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
4523
                     PropertyOp getter, PropertyOp setter, uint32 slot,
4526
                     PropertyOp getter, StrictPropertyOp setter, uint32 slot,
4524
                     uintN attrs, uintN flags, intN shortid)
4527
                     uintN attrs, uintN flags, intN shortid)
4525
{
4528
{
4526
    JS_ASSERT(!(flags & Shape::METHOD));
4529
    JS_ASSERT(!(flags & Shape::METHOD));
 Lines 4543-4549   js_AddNativeProperty(JSContext *cx, JSOb Link Here 
4543
const Shape *
4546
const Shape *
4544
js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
4547
js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
4545
                             const Shape *shape, uintN attrs, uintN mask,
4548
                             const Shape *shape, uintN attrs, uintN mask,
4546
                             PropertyOp getter, PropertyOp setter)
4549
                             PropertyOp getter, StrictPropertyOp setter)
4547
{
4550
{
4548
    if (!obj->ensureClassReservedSlots(cx))
4551
    if (!obj->ensureClassReservedSlots(cx))
4549
        return NULL;
4552
        return NULL;
 Lines 4552-4558   js_ChangeNativePropertyAttrs(JSContext * Link Here 
4552
4555
4553
JSBool
4556
JSBool
4554
js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
4557
js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
4555
                  PropertyOp getter, PropertyOp setter, uintN attrs)
4558
                  PropertyOp getter, StrictPropertyOp setter, uintN attrs)
4556
{
4559
{
4557
    return js_DefineNativeProperty(cx, obj, id, *value, getter, setter, attrs,
4560
    return js_DefineNativeProperty(cx, obj, id, *value, getter, setter, attrs,
4558
                                   0, 0, NULL);
4561
                                   0, 0, NULL);
 Lines 4582-4588   CallAddPropertyHook(JSContext *cx, Class Link Here 
4582
4585
4583
JSBool
4586
JSBool
4584
js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, const Value &value,
4587
js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, const Value &value,
4585
                        PropertyOp getter, PropertyOp setter, uintN attrs,
4588
                        PropertyOp getter, StrictPropertyOp setter, uintN attrs,
4586
                        uintN flags, intN shortid, JSProperty **propp,
4589
                        uintN flags, intN shortid, JSProperty **propp,
4587
                        uintN defineHow /* = 0 */)
4590
                        uintN defineHow /* = 0 */)
4588
{
4591
{
 Lines 5174-5180   js_NativeGet(JSContext *cx, JSObject *ob Link Here 
5174
}
5177
}
5175
5178
5176
JSBool
5179
JSBool
5177
js_NativeSet(JSContext *cx, JSObject *obj, const Shape *shape, bool added, Value *vp)
5180
js_NativeSet(JSContext *cx, JSObject *obj, const Shape *shape, bool added, bool strict, Value *vp)
5178
{
5181
{
5179
    LeaveTraceIfGlobalObject(cx, obj);
5182
    LeaveTraceIfGlobalObject(cx, obj);
5180
5183
 Lines 5209-5215   js_NativeSet(JSContext *cx, JSObject *ob Link Here 
5209
    sample = cx->runtime->propertyRemovals;
5212
    sample = cx->runtime->propertyRemovals;
5210
    {
5213
    {
5211
        AutoShapeRooter tvr(cx, shape);
5214
        AutoShapeRooter tvr(cx, shape);
5212
        if (!shape->set(cx, obj, vp))
5215
        if (!shape->set(cx, obj, strict, vp))
5213
            return false;
5216
            return false;
5214
5217
5215
        JS_ASSERT_IF(!obj->inDictionaryMode(), shape->slot == slot);
5218
        JS_ASSERT_IF(!obj->inDictionaryMode(), shape->slot == slot);
 Lines 5460-5466   js_SetPropertyHelper(JSContext *cx, JSOb Link Here 
5460
    uintN attrs, flags;
5463
    uintN attrs, flags;
5461
    intN shortid;
5464
    intN shortid;
5462
    Class *clasp;
5465
    Class *clasp;
5463
    PropertyOp getter, setter;
5466
    PropertyOp getter;
5467
    StrictPropertyOp setter;
5464
    bool added;
5468
    bool added;
5465
5469
5466
    JS_ASSERT((defineHow &
5470
    JS_ASSERT((defineHow &
 Lines 5483-5489   js_SetPropertyHelper(JSContext *cx, JSOb Link Here 
5483
                    return false;
5487
                    return false;
5484
5488
5485
                if (pd.attrs & JSPROP_SHARED)
5489
                if (pd.attrs & JSPROP_SHARED)
5486
                    return CallSetter(cx, obj, id, pd.setter, pd.attrs, pd.shortid, vp);
5490
                    return CallSetter(cx, obj, id, pd.setter, pd.attrs, pd.shortid, strict, vp);
5487
5491
5488
                if (pd.attrs & JSPROP_READONLY) {
5492
                if (pd.attrs & JSPROP_READONLY) {
5489
                    if (strict)
5493
                    if (strict)
 Lines 5551-5557   js_SetPropertyHelper(JSContext *cx, JSOb Link Here 
5551
                if (shape->hasDefaultSetter() && !shape->hasGetterValue())
5555
                if (shape->hasDefaultSetter() && !shape->hasGetterValue())
5552
                    return JS_TRUE;
5556
                    return JS_TRUE;
5553
5557
5554
                return shape->set(cx, obj, vp);
5558
                return shape->set(cx, obj, strict, vp);
5555
            }
5559
            }
5556
5560
5557
            /*
5561
            /*
 Lines 5616-5622   js_SetPropertyHelper(JSContext *cx, JSOb Link Here 
5616
                    vp->setObject(*funobj);
5620
                    vp->setObject(*funobj);
5617
                }
5621
                }
5618
            }
5622
            }
5619
            return identical || js_NativeSet(cx, obj, shape, false, vp);
5623
            return identical || js_NativeSet(cx, obj, shape, false, strict, vp);
5620
        }
5624
        }
5621
    }
5625
    }
5622
5626
 Lines 5684-5690   js_SetPropertyHelper(JSContext *cx, JSOb Link Here 
5684
    if (defineHow & JSDNP_CACHE_RESULT)
5688
    if (defineHow & JSDNP_CACHE_RESULT)
5685
        JS_PROPERTY_CACHE(cx).fill(cx, obj, 0, 0, obj, shape, added);
5689
        JS_PROPERTY_CACHE(cx).fill(cx, obj, 0, 0, obj, shape, added);
5686
5690
5687
    return js_NativeSet(cx, obj, shape, added, vp);
5691
    return js_NativeSet(cx, obj, shape, added, strict, vp);
5688
5692
5689
#ifdef JS_TRACER
5693
#ifdef JS_TRACER
5690
  error: // TRACE_1 jumps here in case of error.
5694
  error: // TRACE_1 jumps here in case of error.
 Lines 6140-6146   js_SetClassPrototype(JSContext *cx, JSOb Link Here 
6140
     * DontDelete.
6144
     * DontDelete.
6141
     */
6145
     */
6142
    if (!ctor->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom),
6146
    if (!ctor->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.classPrototypeAtom),
6143
                              ObjectOrNullValue(proto), PropertyStub, PropertyStub, attrs)) {
6147
                              ObjectOrNullValue(proto), PropertyStub, StrictPropertyStub, attrs)) {
6144
        return JS_FALSE;
6148
        return JS_FALSE;
6145
    }
6149
    }
6146
6150
 Lines 6149-6155   js_SetClassPrototype(JSContext *cx, JSOb Link Here 
6149
     * for a user-defined function f, is DontEnum.
6153
     * for a user-defined function f, is DontEnum.
6150
     */
6154
     */
6151
    return proto->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
6155
    return proto->defineProperty(cx, ATOM_TO_JSID(cx->runtime->atomState.constructorAtom),
6152
                                 ObjectOrNullValue(ctor), PropertyStub, PropertyStub, 0);
6156
                                 ObjectOrNullValue(ctor), PropertyStub, StrictPropertyStub, 0);
6153
}
6157
}
6154
6158
6155
JSBool
6159
JSBool
(-)a/js/src/jsobj.h (-12 / +30 lines)
Line     Link Here 
 Lines 72-77   CastAsPropertyOp(JSObject *object) Link Here 
72
    return JS_DATA_TO_FUNC_PTR(PropertyOp, object);
72
    return JS_DATA_TO_FUNC_PTR(PropertyOp, object);
73
}
73
}
74
74
75
static inline StrictPropertyOp
76
CastAsStrictPropertyOp(JSObject *object)
77
{
78
    return JS_DATA_TO_FUNC_PTR(StrictPropertyOp, object);
79
}
80
75
static inline JSPropertyOp
81
static inline JSPropertyOp
76
CastAsJSPropertyOp(JSObject *object)
82
CastAsJSPropertyOp(JSObject *object)
77
{
83
{
 Lines 84-95   CastAsObject(PropertyOp op) Link Here 
84
    return JS_FUNC_TO_DATA_PTR(JSObject *, op);
90
    return JS_FUNC_TO_DATA_PTR(JSObject *, op);
85
}
91
}
86
92
93
inline JSObject *
94
CastAsObject(StrictPropertyOp op)
95
{
96
    return JS_FUNC_TO_DATA_PTR(JSObject *, op);
97
}
98
87
inline Value
99
inline Value
88
CastAsObjectJsval(PropertyOp op)
100
CastAsObjectJsval(PropertyOp op)
89
{
101
{
90
    return ObjectOrNullValue(CastAsObject(op));
102
    return ObjectOrNullValue(CastAsObject(op));
91
}
103
}
92
104
105
inline Value
106
CastAsObjectJsval(StrictPropertyOp op)
107
{
108
    return ObjectOrNullValue(CastAsObject(op));
109
}
110
93
} /* namespace js */
111
} /* namespace js */
94
112
95
/*
113
/*
 Lines 149-156   struct PropDesc { Link Here 
149
    js::PropertyOp getter() const {
167
    js::PropertyOp getter() const {
150
        return js::CastAsPropertyOp(getterObject());
168
        return js::CastAsPropertyOp(getterObject());
151
    }
169
    }
152
    js::PropertyOp setter() const {
170
    js::StrictPropertyOp setter() const {
153
        return js::CastAsPropertyOp(setterObject());
171
        return js::CastAsStrictPropertyOp(setterObject());
154
    }
172
    }
155
173
156
    js::Value pd;
174
    js::Value pd;
 Lines 206-212   js_LookupProperty(JSContext *cx, JSObjec Link Here 
206
224
207
extern JSBool
225
extern JSBool
208
js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const js::Value *value,
226
js_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const js::Value *value,
209
                  js::PropertyOp getter, js::PropertyOp setter, uintN attrs);
227
                  js::PropertyOp getter, js::StrictPropertyOp setter, uintN attrs);
210
228
211
extern JSBool
229
extern JSBool
212
js_GetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, js::Value *vp);
230
js_GetProperty(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, js::Value *vp);
 Lines 1132-1138   struct JSObject : js::gc::Cell { Link Here 
1132
     * 2. !isExtensible() checking must be done by callers.
1150
     * 2. !isExtensible() checking must be done by callers.
1133
     */
1151
     */
1134
    const js::Shape *addPropertyInternal(JSContext *cx, jsid id,
1152
    const js::Shape *addPropertyInternal(JSContext *cx, jsid id,
1135
                                         js::PropertyOp getter, js::PropertyOp setter,
1153
                                         js::PropertyOp getter, js::StrictPropertyOp setter,
1136
                                         uint32 slot, uintN attrs,
1154
                                         uint32 slot, uintN attrs,
1137
                                         uintN flags, intN shortid,
1155
                                         uintN flags, intN shortid,
1138
                                         js::Shape **spp);
1156
                                         js::Shape **spp);
 Lines 1142-1148   struct JSObject : js::gc::Cell { Link Here 
1142
  public:
1160
  public:
1143
    /* Add a property whose id is not yet in this scope. */
1161
    /* Add a property whose id is not yet in this scope. */
1144
    const js::Shape *addProperty(JSContext *cx, jsid id,
1162
    const js::Shape *addProperty(JSContext *cx, jsid id,
1145
                                 js::PropertyOp getter, js::PropertyOp setter,
1163
                                 js::PropertyOp getter, js::StrictPropertyOp setter,
1146
                                 uint32 slot, uintN attrs,
1164
                                 uint32 slot, uintN attrs,
1147
                                 uintN flags, intN shortid);
1165
                                 uintN flags, intN shortid);
1148
1166
 Lines 1154-1166   struct JSObject : js::gc::Cell { Link Here 
1154
1172
1155
    /* Add or overwrite a property for id in this scope. */
1173
    /* Add or overwrite a property for id in this scope. */
1156
    const js::Shape *putProperty(JSContext *cx, jsid id,
1174
    const js::Shape *putProperty(JSContext *cx, jsid id,
1157
                                 js::PropertyOp getter, js::PropertyOp setter,
1175
                                 js::PropertyOp getter, js::StrictPropertyOp setter,
1158
                                 uint32 slot, uintN attrs,
1176
                                 uint32 slot, uintN attrs,
1159
                                 uintN flags, intN shortid);
1177
                                 uintN flags, intN shortid);
1160
1178
1161
    /* Change the given property into a sibling with the same id in this scope. */
1179
    /* Change the given property into a sibling with the same id in this scope. */
1162
    const js::Shape *changeProperty(JSContext *cx, const js::Shape *shape, uintN attrs, uintN mask,
1180
    const js::Shape *changeProperty(JSContext *cx, const js::Shape *shape, uintN attrs, uintN mask,
1163
                                    js::PropertyOp getter, js::PropertyOp setter);
1181
                                    js::PropertyOp getter, js::StrictPropertyOp setter);
1164
1182
1165
    /* Remove the property named by id from this object. */
1183
    /* Remove the property named by id from this object. */
1166
    bool removeProperty(JSContext *cx, jsid id);
1184
    bool removeProperty(JSContext *cx, jsid id);
 Lines 1175-1181   struct JSObject : js::gc::Cell { Link Here 
1175
1193
1176
    JSBool defineProperty(JSContext *cx, jsid id, const js::Value &value,
1194
    JSBool defineProperty(JSContext *cx, jsid id, const js::Value &value,
1177
                          js::PropertyOp getter = js::PropertyStub,
1195
                          js::PropertyOp getter = js::PropertyStub,
1178
                          js::PropertyOp setter = js::PropertyStub,
1196
                          js::StrictPropertyOp setter = js::StrictPropertyStub,
1179
                          uintN attrs = JSPROP_ENUMERATE) {
1197
                          uintN attrs = JSPROP_ENUMERATE) {
1180
        js::DefinePropOp op = getOps()->defineProperty;
1198
        js::DefinePropOp op = getOps()->defineProperty;
1181
        return (op ? op : js_DefineProperty)(cx, this, id, &value, getter, setter, attrs);
1199
        return (op ? op : js_DefineProperty)(cx, this, id, &value, getter, setter, attrs);
 Lines 1565-1571   js_PurgeScopeChain(JSContext *cx, JSObje Link Here 
1565
 */
1583
 */
1566
extern const js::Shape *
1584
extern const js::Shape *
1567
js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
1585
js_AddNativeProperty(JSContext *cx, JSObject *obj, jsid id,
1568
                     js::PropertyOp getter, js::PropertyOp setter, uint32 slot,
1586
                     js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot,
1569
                     uintN attrs, uintN flags, intN shortid);
1587
                     uintN attrs, uintN flags, intN shortid);
1570
1588
1571
/*
1589
/*
 Lines 1576-1582   js_AddNativeProperty(JSContext *cx, JSOb Link Here 
1576
extern const js::Shape *
1594
extern const js::Shape *
1577
js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
1595
js_ChangeNativePropertyAttrs(JSContext *cx, JSObject *obj,
1578
                             const js::Shape *shape, uintN attrs, uintN mask,
1596
                             const js::Shape *shape, uintN attrs, uintN mask,
1579
                             js::PropertyOp getter, js::PropertyOp setter);
1597
                             js::PropertyOp getter, js::StrictPropertyOp setter);
1580
1598
1581
extern JSBool
1599
extern JSBool
1582
js_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id,
1600
js_DefineOwnProperty(JSContext *cx, JSObject *obj, jsid id,
 Lines 1601-1607   const uintN JSDNP_UNQUALIFIED = 8; /* U Link Here 
1601
 */
1619
 */
1602
extern JSBool
1620
extern JSBool
1603
js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, const js::Value &value,
1621
js_DefineNativeProperty(JSContext *cx, JSObject *obj, jsid id, const js::Value &value,
1604
                        js::PropertyOp getter, js::PropertyOp setter, uintN attrs,
1622
                        js::PropertyOp getter, js::StrictPropertyOp setter, uintN attrs,
1605
                        uintN flags, intN shortid, JSProperty **propp,
1623
                        uintN flags, intN shortid, JSProperty **propp,
1606
                        uintN defineHow = 0);
1624
                        uintN defineHow = 0);
1607
1625
 Lines 1686-1692   js_NativeGet(JSContext *cx, JSObject *ob Link Here 
1686
1704
1687
extern JSBool
1705
extern JSBool
1688
js_NativeSet(JSContext *cx, JSObject *obj, const js::Shape *shape, bool added,
1706
js_NativeSet(JSContext *cx, JSObject *obj, const js::Shape *shape, bool added,
1689
             js::Value *vp);
1707
             bool strict, js::Value *vp);
1690
1708
1691
extern JSBool
1709
extern JSBool
1692
js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uint32 getHow, js::Value *vp);
1710
js_GetPropertyHelper(JSContext *cx, JSObject *obj, jsid id, uint32 getHow, js::Value *vp);
(-)a/js/src/jsobjinlines.h (-1 / +2 lines)
Line     Link Here 
 Lines 835-841   class AutoPropertyDescriptorRooter : pri Link Here 
835
    AutoPropertyDescriptorRooter(JSContext *cx) : AutoGCRooter(cx, DESCRIPTOR) {
835
    AutoPropertyDescriptorRooter(JSContext *cx) : AutoGCRooter(cx, DESCRIPTOR) {
836
        obj = NULL;
836
        obj = NULL;
837
        attrs = 0;
837
        attrs = 0;
838
        getter = setter = (PropertyOp) NULL;
838
        getter = (PropertyOp) NULL;
839
        setter = (StrictPropertyOp) NULL;
839
        value.setUndefined();
840
        value.setUndefined();
840
    }
841
    }
841
842
(-)a/js/src/json.cpp (-5 / +5 lines)
Line     Link Here 
 Lines 100-109   struct JSONParser Link Here 
100
Class js_JSONClass = {
100
Class js_JSONClass = {
101
    js_JSON_str,
101
    js_JSON_str,
102
    JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
102
    JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
103
    PropertyStub,   /* addProperty */
103
    PropertyStub,        /* addProperty */
104
    PropertyStub,   /* delProperty */
104
    PropertyStub,        /* delProperty */
105
    PropertyStub,   /* getProperty */
105
    PropertyStub,        /* getProperty */
106
    PropertyStub,   /* setProperty */
106
    StrictPropertyStub,  /* setProperty */
107
    EnumerateStub,
107
    EnumerateStub,
108
    ResolveStub,
108
    ResolveStub,
109
    ConvertStub
109
    ConvertStub
 Lines 1259-1265   js_InitJSONClass(JSContext *cx, JSObject Link Here 
1259
    if (!JSON)
1259
    if (!JSON)
1260
        return NULL;
1260
        return NULL;
1261
    if (!JS_DefineProperty(cx, obj, js_JSON_str, OBJECT_TO_JSVAL(JSON),
1261
    if (!JS_DefineProperty(cx, obj, js_JSON_str, OBJECT_TO_JSVAL(JSON),
1262
                           JS_PropertyStub, JS_PropertyStub, 0))
1262
                           JS_PropertyStub, JS_StrictPropertyStub, 0))
1263
        return NULL;
1263
        return NULL;
1264
1264
1265
    if (!JS_DefineFunctions(cx, JSON, json_static_methods))
1265
    if (!JS_DefineFunctions(cx, JSON, json_static_methods))
(-)a/js/src/jsparse.cpp (-3 / +2 lines)
Line     Link Here 
 Lines 1183-1191   Compiler::defineGlobals(JSContext *cx, G Link Here 
1183
1183
1184
        JSProperty *prop;
1184
        JSProperty *prop;
1185
1185
1186
        if (!js_DefineNativeProperty(cx, globalObj, id, rval, PropertyStub,
1186
        if (!js_DefineNativeProperty(cx, globalObj, id, rval, PropertyStub, StrictPropertyStub,
1187
                                     PropertyStub, JSPROP_ENUMERATE | JSPROP_PERMANENT,
1187
                                     JSPROP_ENUMERATE | JSPROP_PERMANENT, 0, 0, &prop)) {
1188
                                     0, 0, &prop)) {
1189
            return false;
1188
            return false;
1190
        }
1189
        }
1191
1190
(-)a/js/src/jsproxy.cpp (-73 / +75 lines)
Line     Link Here 
 Lines 140-146   JSProxyHandler::get(JSContext *cx, JSObj Link Here 
140
}
140
}
141
141
142
bool
142
bool
143
JSProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp)
143
JSProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
144
                    Value *vp)
144
{
145
{
145
    JS_ASSERT(OperationInProgress(cx, proxy));
146
    JS_ASSERT(OperationInProgress(cx, proxy));
146
    AutoPropertyDescriptorRooter desc(cx);
147
    AutoPropertyDescriptorRooter desc(cx);
 Lines 148-155   JSProxyHandler::set(JSContext *cx, JSObj Link Here 
148
        return false;
149
        return false;
149
    /* The control-flow here differs from ::get() because of the fall-through case below. */
150
    /* The control-flow here differs from ::get() because of the fall-through case below. */
150
    if (desc.obj) {
151
    if (desc.obj) {
151
        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != PropertyStub))
152
        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub))
152
            return CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, vp);
153
            return CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp);
153
        if (desc.attrs & JSPROP_READONLY)
154
        if (desc.attrs & JSPROP_READONLY)
154
            return true;
155
            return true;
155
        desc.value = *vp;
156
        desc.value = *vp;
 Lines 158-165   JSProxyHandler::set(JSContext *cx, JSObj Link Here 
158
    if (!getPropertyDescriptor(cx, proxy, id, true, &desc))
159
    if (!getPropertyDescriptor(cx, proxy, id, true, &desc))
159
        return false;
160
        return false;
160
    if (desc.obj) {
161
    if (desc.obj) {
161
        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != PropertyStub))
162
        if (desc.setter && ((desc.attrs & JSPROP_SETTER) || desc.setter != StrictPropertyStub))
162
            return CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, vp);
163
            return CallSetter(cx, receiver, id, desc.setter, desc.attrs, desc.shortid, strict, vp);
163
        if (desc.attrs & JSPROP_READONLY)
164
        if (desc.attrs & JSPROP_READONLY)
164
            return true;
165
            return true;
165
        /* fall through */
166
        /* fall through */
 Lines 450-456   class JSScriptedProxyHandler : public JS Link Here 
450
    virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
451
    virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
451
    virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
452
    virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
452
    virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
453
    virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
453
    virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
454
    virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
455
                     Value *vp);
454
    virtual bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props);
456
    virtual bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props);
455
    virtual bool iterate(JSContext *cx, JSObject *proxy, uintN flags, Value *vp);
457
    virtual bool iterate(JSContext *cx, JSObject *proxy, uintN flags, Value *vp);
456
458
 Lines 606-612   JSScriptedProxyHandler::get(JSContext *c Link Here 
606
}
608
}
607
609
608
bool
610
bool
609
JSScriptedProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp)
611
JSScriptedProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
612
                            Value *vp)
610
{
613
{
611
    JSObject *handler = GetProxyHandlerObject(cx, proxy);
614
    JSObject *handler = GetProxyHandlerObject(cx, proxy);
612
    JSString *str = js_ValueToString(cx, IdToValue(id));
615
    JSString *str = js_ValueToString(cx, IdToValue(id));
 Lines 618-624   JSScriptedProxyHandler::set(JSContext *c Link Here 
618
    if (!GetDerivedTrap(cx, handler, ATOM(set), fval.addr()))
621
    if (!GetDerivedTrap(cx, handler, ATOM(set), fval.addr()))
619
        return false;
622
        return false;
620
    if (!js_IsCallable(fval.value()))
623
    if (!js_IsCallable(fval.value()))
621
        return JSProxyHandler::set(cx, proxy, receiver, id, vp);
624
        return JSProxyHandler::set(cx, proxy, receiver, id, strict, vp);
622
    return Trap(cx, handler, fval.value(), 3, argv, tvr.addr());
625
    return Trap(cx, handler, fval.value(), 3, argv, tvr.addr());
623
}
626
}
624
627
 Lines 779-789   JSProxy::get(JSContext *cx, JSObject *pr Link Here 
779
}
782
}
780
783
781
bool
784
bool
782
JSProxy::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp)
785
JSProxy::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, Value *vp)
783
{
786
{
784
    JS_CHECK_RECURSION(cx, return false);
787
    JS_CHECK_RECURSION(cx, return false);
785
    AutoPendingProxyOperation pending(cx, proxy);
788
    AutoPendingProxyOperation pending(cx, proxy);
786
    return proxy->getProxyHandler()->set(cx, proxy, receiver, id, vp);
789
    return proxy->getProxyHandler()->set(cx, proxy, receiver, id, strict, vp);
787
}
790
}
788
791
789
bool
792
bool
 Lines 877-883   proxy_LookupProperty(JSContext *cx, JSOb Link Here 
877
880
878
static JSBool
881
static JSBool
879
proxy_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
882
proxy_DefineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
880
                     PropertyOp getter, PropertyOp setter, uintN attrs)
883
                     PropertyOp getter, StrictPropertyOp setter, uintN attrs)
881
{
884
{
882
    AutoPropertyDescriptorRooter desc(cx);
885
    AutoPropertyDescriptorRooter desc(cx);
883
    desc.obj = obj;
886
    desc.obj = obj;
 Lines 898-905   proxy_GetProperty(JSContext *cx, JSObjec Link Here 
898
static JSBool
901
static JSBool
899
proxy_SetProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
902
proxy_SetProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
900
{
903
{
901
    // FIXME (bug 596351): throwing away strict.
904
    return JSProxy::set(cx, obj, obj, id, strict, vp);
902
    return JSProxy::set(cx, obj, obj, id, vp);
903
}
905
}
904
906
905
static JSBool
907
static JSBool
 Lines 980-1000   proxy_TypeOf(JSContext *cx, JSObject *pr Link Here 
980
JS_FRIEND_API(Class) ObjectProxyClass = {
982
JS_FRIEND_API(Class) ObjectProxyClass = {
981
    "Proxy",
983
    "Proxy",
982
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
984
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
983
    PropertyStub,   /* addProperty */
985
    PropertyStub,         /* addProperty */
984
    PropertyStub,   /* delProperty */
986
    PropertyStub,         /* delProperty */
985
    PropertyStub,   /* getProperty */
987
    PropertyStub,         /* getProperty */
986
    PropertyStub,   /* setProperty */
988
    StrictPropertyStub,   /* setProperty */
987
    EnumerateStub,
989
    EnumerateStub,
988
    ResolveStub,
990
    ResolveStub,
989
    ConvertStub,
991
    ConvertStub,
990
    NULL,           /* finalize */
992
    NULL,                 /* finalize */
991
    NULL,           /* reserved0   */
993
    NULL,                 /* reserved0   */
992
    NULL,           /* checkAccess */
994
    NULL,                 /* checkAccess */
993
    NULL,           /* call        */
995
    NULL,                 /* call        */
994
    NULL,           /* construct   */
996
    NULL,                 /* construct   */
995
    NULL,           /* xdrObject   */
997
    NULL,                 /* xdrObject   */
996
    proxy_HasInstance, /* hasInstance */
998
    proxy_HasInstance,    /* hasInstance */
997
    NULL,           /* mark        */
999
    NULL,                 /* mark        */
998
    JS_NULL_CLASS_EXT,
1000
    JS_NULL_CLASS_EXT,
999
    {
1001
    {
1000
        proxy_LookupProperty,
1002
        proxy_LookupProperty,
 Lines 1004-1039   JS_FRIEND_API(Class) ObjectProxyClass = Link Here 
1004
        proxy_GetAttributes,
1006
        proxy_GetAttributes,
1005
        proxy_SetAttributes,
1007
        proxy_SetAttributes,
1006
        proxy_DeleteProperty,
1008
        proxy_DeleteProperty,
1007
        NULL,       /* enumerate       */
1009
        NULL,             /* enumerate       */
1008
        proxy_TypeOf,
1010
        proxy_TypeOf,
1009
        proxy_TraceObject,
1011
        proxy_TraceObject,
1010
        NULL,       /* fix             */
1012
        NULL,             /* fix             */
1011
        NULL,       /* thisObject      */
1013
        NULL,             /* thisObject      */
1012
        proxy_Finalize, /* clear */
1014
        proxy_Finalize,   /* clear */
1013
    }
1015
    }
1014
};
1016
};
1015
1017
1016
JS_FRIEND_API(Class) OuterWindowProxyClass = {
1018
JS_FRIEND_API(Class) OuterWindowProxyClass = {
1017
    "Proxy",
1019
    "Proxy",
1018
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
1020
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(3),
1019
    PropertyStub,   /* addProperty */
1021
    PropertyStub,         /* addProperty */
1020
    PropertyStub,   /* delProperty */
1022
    PropertyStub,         /* delProperty */
1021
    PropertyStub,   /* getProperty */
1023
    PropertyStub,         /* getProperty */
1022
    PropertyStub,   /* setProperty */
1024
    StrictPropertyStub,   /* setProperty */
1023
    EnumerateStub,
1025
    EnumerateStub,
1024
    ResolveStub,
1026
    ResolveStub,
1025
    ConvertStub,
1027
    ConvertStub,
1026
    NULL,           /* finalize */
1028
    NULL,                 /* finalize */
1027
    NULL,           /* reserved0   */
1029
    NULL,                 /* reserved0   */
1028
    NULL,           /* checkAccess */
1030
    NULL,                 /* checkAccess */
1029
    NULL,           /* call        */
1031
    NULL,                 /* call        */
1030
    NULL,           /* construct   */
1032
    NULL,                 /* construct   */
1031
    NULL,           /* xdrObject   */
1033
    NULL,                 /* xdrObject   */
1032
    NULL,           /* hasInstance */
1034
    NULL,                 /* hasInstance */
1033
    NULL,           /* mark        */
1035
    NULL,                 /* mark        */
1034
    {
1036
    {
1035
        NULL,       /* equality    */
1037
        NULL,             /* equality    */
1036
        NULL,       /* outerObject */
1038
        NULL,             /* outerObject */
1037
        proxy_innerObject,
1039
        proxy_innerObject,
1038
        NULL        /* unused */
1040
        NULL        /* unused */
1039
    },
1041
    },
 Lines 1045-1056   JS_FRIEND_API(Class) OuterWindowProxyCla Link Here 
1045
        proxy_GetAttributes,
1047
        proxy_GetAttributes,
1046
        proxy_SetAttributes,
1048
        proxy_SetAttributes,
1047
        proxy_DeleteProperty,
1049
        proxy_DeleteProperty,
1048
        NULL,       /* enumerate       */
1050
        NULL,             /* enumerate       */
1049
        NULL,       /* typeof          */
1051
        NULL,             /* typeof          */
1050
        proxy_TraceObject,
1052
        proxy_TraceObject,
1051
        NULL,       /* fix             */
1053
        NULL,             /* fix             */
1052
        NULL,       /* thisObject      */
1054
        NULL,             /* thisObject      */
1053
        proxy_Finalize, /* clear */
1055
        proxy_Finalize,   /* clear */
1054
    }
1056
    }
1055
};
1057
};
1056
1058
 Lines 1076-1096   proxy_Construct(JSContext *cx, uintN arg Link Here 
1076
JS_FRIEND_API(Class) FunctionProxyClass = {
1078
JS_FRIEND_API(Class) FunctionProxyClass = {
1077
    "Proxy",
1079
    "Proxy",
1078
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(5),
1080
    Class::NON_NATIVE | JSCLASS_HAS_RESERVED_SLOTS(5),
1079
    PropertyStub,   /* addProperty */
1081
    PropertyStub,         /* addProperty */
1080
    PropertyStub,   /* delProperty */
1082
    PropertyStub,         /* delProperty */
1081
    PropertyStub,   /* getProperty */
1083
    PropertyStub,         /* getProperty */
1082
    PropertyStub,   /* setProperty */
1084
    StrictPropertyStub,   /* setProperty */
1083
    EnumerateStub,
1085
    EnumerateStub,
1084
    ResolveStub,
1086
    ResolveStub,
1085
    ConvertStub,
1087
    ConvertStub,
1086
    NULL,           /* finalize */
1088
    NULL,                 /* finalize */
1087
    NULL,           /* reserved0   */
1089
    NULL,                 /* reserved0   */
1088
    NULL,           /* checkAccess */
1090
    NULL,                 /* checkAccess */
1089
    proxy_Call,
1091
    proxy_Call,
1090
    proxy_Construct,
1092
    proxy_Construct,
1091
    NULL,           /* xdrObject   */
1093
    NULL,                 /* xdrObject   */
1092
    js_FunctionClass.hasInstance,
1094
    js_FunctionClass.hasInstance,
1093
    NULL,           /* mark */
1095
    NULL,                 /* mark */
1094
    JS_NULL_CLASS_EXT,
1096
    JS_NULL_CLASS_EXT,
1095
    {
1097
    {
1096
        proxy_LookupProperty,
1098
        proxy_LookupProperty,
 Lines 1100-1111   JS_FRIEND_API(Class) FunctionProxyClass Link Here 
1100
        proxy_GetAttributes,
1102
        proxy_GetAttributes,
1101
        proxy_SetAttributes,
1103
        proxy_SetAttributes,
1102
        proxy_DeleteProperty,
1104
        proxy_DeleteProperty,
1103
        NULL,       /* enumerate       */
1105
        NULL,             /* enumerate       */
1104
        proxy_TypeOf,
1106
        proxy_TypeOf,
1105
        proxy_TraceObject,
1107
        proxy_TraceObject,
1106
        NULL,       /* fix             */
1108
        NULL,             /* fix             */
1107
        NULL,       /* thisObject      */
1109
        NULL,             /* thisObject      */
1108
        NULL,       /* clear           */
1110
        NULL,             /* clear           */
1109
    }
1111
    }
1110
};
1112
};
1111
1113
 Lines 1337-1352   callable_Construct(JSContext *cx, uintN Link Here 
1337
Class CallableObjectClass = {
1339
Class CallableObjectClass = {
1338
    "Function",
1340
    "Function",
1339
    JSCLASS_HAS_RESERVED_SLOTS(2),
1341
    JSCLASS_HAS_RESERVED_SLOTS(2),
1340
    PropertyStub,   /* addProperty */
1342
    PropertyStub,         /* addProperty */
1341
    PropertyStub,   /* delProperty */
1343
    PropertyStub,         /* delProperty */
1342
    PropertyStub,   /* getProperty */
1344
    PropertyStub,         /* getProperty */
1343
    PropertyStub,   /* setProperty */
1345
    StrictPropertyStub,   /* setProperty */
1344
    EnumerateStub,
1346
    EnumerateStub,
1345
    ResolveStub,
1347
    ResolveStub,
1346
    ConvertStub,
1348
    ConvertStub,
1347
    NULL,           /* finalize    */
1349
    NULL,                 /* finalize    */
1348
    NULL,           /* reserved0   */
1350
    NULL,                 /* reserved0   */
1349
    NULL,           /* checkAccess */
1351
    NULL,                 /* checkAccess */
1350
    callable_Call,
1352
    callable_Call,
1351
    callable_Construct,
1353
    callable_Construct,
1352
};
1354
};
 Lines 1411-1420   FixProxy(JSContext *cx, JSObject *proxy, Link Here 
1411
Class js_ProxyClass = {
1413
Class js_ProxyClass = {
1412
    "Proxy",
1414
    "Proxy",
1413
    JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy),
1415
    JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy),
1414
    PropertyStub,   /* addProperty */
1416
    PropertyStub,         /* addProperty */
1415
    PropertyStub,   /* delProperty */
1417
    PropertyStub,         /* delProperty */
1416
    PropertyStub,   /* getProperty */
1418
    PropertyStub,         /* getProperty */
1417
    PropertyStub,   /* setProperty */
1419
    StrictPropertyStub,   /* setProperty */
1418
    EnumerateStub,
1420
    EnumerateStub,
1419
    ResolveStub,
1421
    ResolveStub,
1420
    ConvertStub
1422
    ConvertStub
 Lines 1427-1433   js_InitProxyClass(JSContext *cx, JSObjec Link Here 
1427
    if (!module)
1429
    if (!module)
1428
        return NULL;
1430
        return NULL;
1429
    if (!JS_DefineProperty(cx, obj, "Proxy", OBJECT_TO_JSVAL(module),
1431
    if (!JS_DefineProperty(cx, obj, "Proxy", OBJECT_TO_JSVAL(module),
1430
                           JS_PropertyStub, JS_PropertyStub, 0)) {
1432
                           JS_PropertyStub, JS_StrictPropertyStub, 0)) {
1431
        return NULL;
1433
        return NULL;
1432
    }
1434
    }
1433
    if (!JS_DefineFunctions(cx, module, static_methods))
1435
    if (!JS_DefineFunctions(cx, module, static_methods))
(-)a/js/src/jsproxy.h (-2 / +4 lines)
Line     Link Here 
 Lines 71-77   class JS_FRIEND_API(JSProxyHandler) { Link Here 
71
    virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
71
    virtual bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
72
    virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
72
    virtual bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
73
    virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, js::Value *vp);
73
    virtual bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, js::Value *vp);
74
    virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, js::Value *vp);
74
    virtual bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
75
                     js::Value *vp);
75
    virtual bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
76
    virtual bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
76
    virtual bool iterate(JSContext *cx, JSObject *proxy, uintN flags, js::Value *vp);
77
    virtual bool iterate(JSContext *cx, JSObject *proxy, uintN flags, js::Value *vp);
77
78
 Lines 117-123   class JSProxy { Link Here 
117
    static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
118
    static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
118
    static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
119
    static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp);
119
    static bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
120
    static bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
120
    static bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp);
121
    static bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict,
122
                    Value *vp);
121
    static bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
123
    static bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props);
122
    static bool iterate(JSContext *cx, JSObject *proxy, uintN flags, Value *vp);
124
    static bool iterate(JSContext *cx, JSObject *proxy, uintN flags, Value *vp);
123
125
(-)a/js/src/jspubtd.h (-2 / +12 lines)
Line     Link Here 
 Lines 177-192   typedef class JSCrossCompartmentWrapper Link Here 
177
/* JSClass (and js::ObjectOps where appropriate) function pointer typedefs. */
177
/* JSClass (and js::ObjectOps where appropriate) function pointer typedefs. */
178
178
179
/*
179
/*
180
 * Add, delete, get or set a property named by id in obj.  Note the jsid id
180
 * Add, delete, or get a property named by id in obj.  Note the jsid id
181
 * type -- id may be a string (Unicode property identifier) or an int (element
181
 * type -- id may be a string (Unicode property identifier) or an int (element
182
 * index).  The *vp out parameter, on success, is the new property value after
182
 * index).  The *vp out parameter, on success, is the new property value after
183
 * an add, get, or set.  After a successful delete, *vp is JSVAL_FALSE iff
183
 * an add or get.  After a successful delete, *vp is JSVAL_FALSE iff
184
 * obj[id] can't be deleted (because it's permanent).
184
 * obj[id] can't be deleted (because it's permanent).
185
 */
185
 */
186
typedef JSBool
186
typedef JSBool
187
(* JSPropertyOp)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
187
(* JSPropertyOp)(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
188
188
189
/*
189
/*
190
 * Set a property named by id in obj, treating the assignment as strict
191
 * mode code if strict is true. Note the jsid id type -- id may be a string
192
 * (Unicode property identifier) or an int (element index). The *vp out
193
 * parameter, on success, is the new property value after the
194
 * set.
195
 */
196
typedef JSBool
197
(* JSStrictPropertyOp)(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
198
199
/*
190
 * This function type is used for callbacks that enumerate the properties of
200
 * This function type is used for callbacks that enumerate the properties of
191
 * a JSObject.  The behavior depends on the value of enum_op:
201
 * a JSObject.  The behavior depends on the value of enum_op:
192
 *
202
 *
(-)a/js/src/jsreflect.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 3173-3179   Class js_ReflectClass = { Link Here 
3173
    PropertyStub,
3173
    PropertyStub,
3174
    PropertyStub,
3174
    PropertyStub,
3175
    PropertyStub,
3175
    PropertyStub,
3176
    PropertyStub,
3176
    StrictPropertyStub,
3177
    EnumerateStub,
3177
    EnumerateStub,
3178
    ResolveStub,
3178
    ResolveStub,
3179
    ConvertStub
3179
    ConvertStub
 Lines 3310-3316   js_InitReflectClass(JSContext *cx, JSObj Link Here 
3310
        return NULL;
3310
        return NULL;
3311
3311
3312
    if (!JS_DefineProperty(cx, obj, js_Reflect_str, OBJECT_TO_JSVAL(Reflect),
3312
    if (!JS_DefineProperty(cx, obj, js_Reflect_str, OBJECT_TO_JSVAL(Reflect),
3313
                           JS_PropertyStub, JS_PropertyStub, 0)) {
3313
                           JS_PropertyStub, JS_StrictPropertyStub, 0)) {
3314
        return NULL;
3314
        return NULL;
3315
    }
3315
    }
3316
3316
(-)a/js/src/jsregexp.cpp (-20 / +20 lines)
Line     Link Here 
 Lines 95-114   resc_trace(JSTracer *trc, JSObject *obj) Link Here 
95
Class js::regexp_statics_class = {
95
Class js::regexp_statics_class = {
96
    "RegExpStatics", 
96
    "RegExpStatics", 
97
    JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
97
    JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
98
    PropertyStub,   /* addProperty */
98
    PropertyStub,         /* addProperty */
99
    PropertyStub,   /* delProperty */
99
    PropertyStub,         /* delProperty */
100
    PropertyStub,   /* getProperty */
100
    PropertyStub,         /* getProperty */
101
    PropertyStub,   /* setProperty */
101
    StrictPropertyStub,   /* setProperty */
102
    EnumerateStub,
102
    EnumerateStub,
103
    ResolveStub,
103
    ResolveStub,
104
    ConvertStub,
104
    ConvertStub,
105
    resc_finalize,
105
    resc_finalize,
106
    NULL,           /* reserved0   */
106
    NULL,                 /* reserved0   */
107
    NULL,           /* checkAccess */
107
    NULL,                 /* checkAccess */
108
    NULL,           /* call        */
108
    NULL,                 /* call        */
109
    NULL,           /* construct   */
109
    NULL,                 /* construct   */
110
    NULL,           /* xdrObject   */
110
    NULL,                 /* xdrObject   */
111
    NULL,           /* hasInstance */
111
    NULL,                 /* hasInstance */
112
    JS_CLASS_TRACE(resc_trace)
112
    JS_CLASS_TRACE(resc_trace)
113
};
113
};
114
114
 Lines 320-326   DEFINE_GETTER(multiline_getter, *vp = B Link Here 
320
DEFINE_GETTER(sticky_getter,     *vp = BooleanValue(re->sticky()))
320
DEFINE_GETTER(sticky_getter,     *vp = BooleanValue(re->sticky()))
321
321
322
static JSBool
322
static JSBool
323
lastIndex_setter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
323
lastIndex_setter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
324
{
324
{
325
    while (obj->getClass() != &js_RegExpClass) {
325
    while (obj->getClass() != &js_RegExpClass) {
326
        obj = obj->getProto();
326
        obj = obj->getProto();
 Lines 421-427   DEFINE_STATIC_GETTER(static_paren9_gette Link Here 
421
421
422
#define DEFINE_STATIC_SETTER(name, code)                                        \
422
#define DEFINE_STATIC_SETTER(name, code)                                        \
423
    static JSBool                                                               \
423
    static JSBool                                                               \
424
    name(JSContext *cx, JSObject *obj, jsid id, jsval *vp)                      \
424
    name(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)       \
425
    {                                                                           \
425
    {                                                                           \
426
        RegExpStatics *res = cx->regExpStatics();                               \
426
        RegExpStatics *res = cx->regExpStatics();                               \
427
        code;                                                                   \
427
        code;                                                                   \
 Lines 553-572   js::Class js_RegExpClass = { Link Here 
553
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
553
    JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE |
554
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::REGEXP_CLASS_RESERVED_SLOTS) |
554
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::REGEXP_CLASS_RESERVED_SLOTS) |
555
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
555
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
556
    PropertyStub,   /* addProperty */
556
    PropertyStub,         /* addProperty */
557
    PropertyStub,   /* delProperty */
557
    PropertyStub,         /* delProperty */
558
    PropertyStub,   /* getProperty */
558
    PropertyStub,         /* getProperty */
559
    PropertyStub,   /* setProperty */
559
    StrictPropertyStub,   /* setProperty */
560
    regexp_enumerate,
560
    regexp_enumerate,
561
    reinterpret_cast<JSResolveOp>(regexp_resolve),
561
    reinterpret_cast<JSResolveOp>(regexp_resolve),
562
    ConvertStub,
562
    ConvertStub,
563
    regexp_finalize,
563
    regexp_finalize,
564
    NULL,           /* reserved0 */
564
    NULL,                 /* reserved0 */
565
    NULL,           /* checkAccess */
565
    NULL,                 /* checkAccess */
566
    regexp_call,
566
    regexp_call,
567
    NULL,           /* construct */
567
    NULL,                 /* construct */
568
    js_XDRRegExpObject,
568
    js_XDRRegExpObject,
569
    NULL,           /* hasInstance */
569
    NULL,                 /* hasInstance */
570
    JS_CLASS_TRACE(regexp_trace)
570
    JS_CLASS_TRACE(regexp_trace)
571
};
571
};
572
572
(-)a/js/src/jsregexpinlines.h (-1 / +1 lines)
Line     Link Here 
 Lines 215-221   class RegExpMatchBuilder Link Here 
215
    }
215
    }
216
216
217
    bool append(jsid id, Value val) {
217
    bool append(jsid id, Value val) {
218
        return !!js_DefineProperty(cx, array, id, &val, js::PropertyStub, js::PropertyStub,
218
        return !!js_DefineProperty(cx, array, id, &val, js::PropertyStub, js::StrictPropertyStub,
219
                                   JSPROP_ENUMERATE);
219
                                   JSPROP_ENUMERATE);
220
    }
220
    }
221
221
(-)a/js/src/jsscope.cpp (-8 / +8 lines)
Line     Link Here 
 Lines 602-608   Shape::newDictionaryShape(JSContext *cx, Link Here 
602
602
603
Shape *
603
Shape *
604
Shape::newDictionaryShapeForAddProperty(JSContext *cx, jsid id,
604
Shape::newDictionaryShapeForAddProperty(JSContext *cx, jsid id,
605
                                        PropertyOp getter, PropertyOp setter,
605
                                        PropertyOp getter, StrictPropertyOp setter,
606
                                        uint32 slot, uintN attrs, uintN flags, intN shortid)
606
                                        uint32 slot, uintN attrs, uintN flags, intN shortid)
607
{
607
{
608
    Shape *shape = JS_PROPERTY_TREE(cx).newShape(cx);
608
    Shape *shape = JS_PROPERTY_TREE(cx).newShape(cx);
 Lines 666-674   static inline bool Link Here 
666
NormalizeGetterAndSetter(JSContext *cx, JSObject *obj,
666
NormalizeGetterAndSetter(JSContext *cx, JSObject *obj,
667
                         jsid id, uintN attrs, uintN flags,
667
                         jsid id, uintN attrs, uintN flags,
668
                         PropertyOp &getter,
668
                         PropertyOp &getter,
669
                         PropertyOp &setter)
669
                         StrictPropertyOp &setter)
670
{
670
{
671
    if (setter == PropertyStub) {
671
    if (setter == StrictPropertyStub) {
672
        JS_ASSERT(!(attrs & JSPROP_SETTER));
672
        JS_ASSERT(!(attrs & JSPROP_SETTER));
673
        setter = NULL;
673
        setter = NULL;
674
    }
674
    }
 Lines 772-778   JSObject::checkShapeConsistency() Link Here 
772
772
773
const Shape *
773
const Shape *
774
JSObject::addProperty(JSContext *cx, jsid id,
774
JSObject::addProperty(JSContext *cx, jsid id,
775
                      PropertyOp getter, PropertyOp setter,
775
                      PropertyOp getter, StrictPropertyOp setter,
776
                      uint32 slot, uintN attrs,
776
                      uint32 slot, uintN attrs,
777
                      uintN flags, intN shortid)
777
                      uintN flags, intN shortid)
778
{
778
{
 Lines 804-810   JSObject::addProperty(JSContext *cx, jsi Link Here 
804
804
805
const Shape *
805
const Shape *
806
JSObject::addPropertyInternal(JSContext *cx, jsid id,
806
JSObject::addPropertyInternal(JSContext *cx, jsid id,
807
                              PropertyOp getter, PropertyOp setter,
807
                              PropertyOp getter, StrictPropertyOp setter,
808
                              uint32 slot, uintN attrs,
808
                              uint32 slot, uintN attrs,
809
                              uintN flags, intN shortid,
809
                              uintN flags, intN shortid,
810
                              Shape **spp)
810
                              Shape **spp)
 Lines 867-873   JSObject::addPropertyInternal(JSContext Link Here 
867
867
868
const Shape *
868
const Shape *
869
JSObject::putProperty(JSContext *cx, jsid id,
869
JSObject::putProperty(JSContext *cx, jsid id,
870
                      PropertyOp getter, PropertyOp setter,
870
                      PropertyOp getter, StrictPropertyOp setter,
871
                      uint32 slot, uintN attrs,
871
                      uint32 slot, uintN attrs,
872
                      uintN flags, intN shortid)
872
                      uintN flags, intN shortid)
873
{
873
{
 Lines 1047-1053   JSObject::putProperty(JSContext *cx, jsi Link Here 
1047
1047
1048
const Shape *
1048
const Shape *
1049
JSObject::changeProperty(JSContext *cx, const Shape *shape, uintN attrs, uintN mask,
1049
JSObject::changeProperty(JSContext *cx, const Shape *shape, uintN attrs, uintN mask,
1050
                         PropertyOp getter, PropertyOp setter)
1050
                         PropertyOp getter, StrictPropertyOp setter)
1051
{
1051
{
1052
    JS_ASSERT_IF(inDictionaryMode(), !lastProp->frozen());
1052
    JS_ASSERT_IF(inDictionaryMode(), !lastProp->frozen());
1053
    JS_ASSERT(!JSID_IS_VOID(shape->id));
1053
    JS_ASSERT(!JSID_IS_VOID(shape->id));
 Lines 1064-1070   JSObject::changeProperty(JSContext *cx, Link Here 
1064
1064
1065
    if (getter == PropertyStub)
1065
    if (getter == PropertyStub)
1066
        getter = NULL;
1066
        getter = NULL;
1067
    if (setter == PropertyStub)
1067
    if (setter == StrictPropertyStub)
1068
        setter = NULL;
1068
        setter = NULL;
1069
    if (shape->attrs == attrs && shape->getter() == getter && shape->setter() == setter)
1069
    if (shape->attrs == attrs && shape->getter() == getter && shape->setter() == setter)
1070
        return shape;
1070
        return shape;
(-)a/js/src/jsscope.h (-7 / +7 lines)
Line     Link Here 
 Lines 331-337   struct Shape : public JSObjectMap Link Here 
331
    };
331
    };
332
332
333
    union {
333
    union {
334
        js::PropertyOp  rawSetter;      /* getter is JSObject* and setter is 0
334
        js::StrictPropertyOp  rawSetter;/* getter is JSObject* and setter is 0
335
                                           if shape->isMethod() */
335
                                           if shape->isMethod() */
336
        JSObject        *setterObj;     /* user-defined callable "set" object or
336
        JSObject        *setterObj;     /* user-defined callable "set" object or
337
                                           null if shape->hasSetterValue() */
337
                                           null if shape->hasSetterValue() */
 Lines 361-367   struct Shape : public JSObjectMap Link Here 
361
    static js::Shape *newDictionaryShape(JSContext *cx, const js::Shape &child, js::Shape **listp);
361
    static js::Shape *newDictionaryShape(JSContext *cx, const js::Shape &child, js::Shape **listp);
362
    static js::Shape *newDictionaryList(JSContext *cx, js::Shape **listp);
362
    static js::Shape *newDictionaryList(JSContext *cx, js::Shape **listp);
363
    static js::Shape *newDictionaryShapeForAddProperty(JSContext *cx, jsid id,
363
    static js::Shape *newDictionaryShapeForAddProperty(JSContext *cx, jsid id,
364
                                                       PropertyOp getter, PropertyOp setter,
364
                                                       PropertyOp getter, StrictPropertyOp setter,
365
                                                       uint32 slot, uintN attrs,
365
                                                       uint32 slot, uintN attrs,
366
                                                       uintN flags, intN shortid);
366
                                                       uintN flags, intN shortid);
367
367
 Lines 505-511   struct Shape : public JSObjectMap Link Here 
505
        FROZEN          = 0x10
505
        FROZEN          = 0x10
506
    };
506
    };
507
507
508
    Shape(jsid id, js::PropertyOp getter, js::PropertyOp setter, uint32 slot, uintN attrs,
508
    Shape(jsid id, js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot, uintN attrs,
509
          uintN flags, intN shortid, uint32 shape = INVALID_SHAPE, uint32 slotSpan = 0);
509
          uintN flags, intN shortid, uint32 shape = INVALID_SHAPE, uint32 slotSpan = 0);
510
510
511
    /* Used by EmptyShape (see jsscopeinlines.h). */
511
    /* Used by EmptyShape (see jsscopeinlines.h). */
 Lines 556-564   struct Shape : public JSObjectMap Link Here 
556
        return hasGetterValue() && getterObj ? js::ObjectValue(*getterObj) : js::UndefinedValue();
556
        return hasGetterValue() && getterObj ? js::ObjectValue(*getterObj) : js::UndefinedValue();
557
    }
557
    }
558
558
559
    js::PropertyOp setter() const { return rawSetter; }
559
    js::StrictPropertyOp setter() const { return rawSetter; }
560
    bool hasDefaultSetter() const  { return !rawSetter; }
560
    bool hasDefaultSetter() const  { return !rawSetter; }
561
    js::PropertyOp setterOp() const { JS_ASSERT(!hasSetterValue()); return rawSetter; }
561
    js::StrictPropertyOp setterOp() const { JS_ASSERT(!hasSetterValue()); return rawSetter; }
562
    JSObject *setterObject() const { JS_ASSERT(hasSetterValue()); return setterObj; }
562
    JSObject *setterObject() const { JS_ASSERT(hasSetterValue()); return setterObj; }
563
563
564
    // Per ES5, decode null setterObj as the undefined value, which encodes as null.
564
    // Per ES5, decode null setterObj as the undefined value, which encodes as null.
 Lines 573-584   struct Shape : public JSObjectMap Link Here 
573
573
574
    inline JSDHashNumber hash() const;
574
    inline JSDHashNumber hash() const;
575
    inline bool matches(const js::Shape *p) const;
575
    inline bool matches(const js::Shape *p) const;
576
    inline bool matchesParamsAfterId(js::PropertyOp agetter, js::PropertyOp asetter,
576
    inline bool matchesParamsAfterId(js::PropertyOp agetter, js::StrictPropertyOp asetter,
577
                                     uint32 aslot, uintN aattrs, uintN aflags,
577
                                     uint32 aslot, uintN aattrs, uintN aflags,
578
                                     intN ashortid) const;
578
                                     intN ashortid) const;
579
579
580
    bool get(JSContext* cx, JSObject *receiver, JSObject *obj, JSObject *pobj, js::Value* vp) const;
580
    bool get(JSContext* cx, JSObject *receiver, JSObject *obj, JSObject *pobj, js::Value* vp) const;
581
    bool set(JSContext* cx, JSObject *obj, js::Value* vp) const;
581
    bool set(JSContext* cx, JSObject *obj, bool strict, js::Value* vp) const;
582
582
583
    inline bool isSharedPermanent() const;
583
    inline bool isSharedPermanent() const;
584
584
(-)a/js/src/jsscopeinlines.h (-4 / +4 lines)
Line     Link Here 
 Lines 167-173   JSObject::trace(JSTracer *trc) Link Here 
167
namespace js {
167
namespace js {
168
168
169
inline
169
inline
170
Shape::Shape(jsid id, js::PropertyOp getter, js::PropertyOp setter, uint32 slot, uintN attrs,
170
Shape::Shape(jsid id, js::PropertyOp getter, js::StrictPropertyOp setter, uint32 slot, uintN attrs,
171
             uintN flags, intN shortid, uint32 shape, uint32 slotSpan)
171
             uintN flags, intN shortid, uint32 shape, uint32 slotSpan)
172
  : JSObjectMap(shape, slotSpan),
172
  : JSObjectMap(shape, slotSpan),
173
    numSearches(0), table(NULL), id(id), rawGetter(getter), rawSetter(setter), slot(slot),
173
    numSearches(0), table(NULL), id(id), rawGetter(getter), rawSetter(setter), slot(slot),
 Lines 218-224   Shape::matches(const js::Shape *other) c Link Here 
218
}
218
}
219
219
220
inline bool
220
inline bool
221
Shape::matchesParamsAfterId(js::PropertyOp agetter, js::PropertyOp asetter, uint32 aslot,
221
Shape::matchesParamsAfterId(js::PropertyOp agetter, js::StrictPropertyOp asetter, uint32 aslot,
222
                            uintN aattrs, uintN aflags, intN ashortid) const
222
                            uintN aattrs, uintN aflags, intN ashortid) const
223
{
223
{
224
    JS_ASSERT(!JSID_IS_VOID(id));
224
    JS_ASSERT(!JSID_IS_VOID(id));
 Lines 257-263   Shape::get(JSContext* cx, JSObject *rece Link Here 
257
}
257
}
258
258
259
inline bool
259
inline bool
260
Shape::set(JSContext* cx, JSObject* obj, js::Value* vp) const
260
Shape::set(JSContext* cx, JSObject* obj, bool strict, js::Value* vp) const
261
{
261
{
262
    JS_ASSERT_IF(hasDefaultSetter(), hasGetterValue());
262
    JS_ASSERT_IF(hasDefaultSetter(), hasGetterValue());
263
263
 Lines 272-278   Shape::set(JSContext* cx, JSObject* obj, Link Here 
272
    /* See the comment in js::Shape::get as to why we check for With. */
272
    /* See the comment in js::Shape::get as to why we check for With. */
273
    if (obj->getClass() == &js_WithClass)
273
    if (obj->getClass() == &js_WithClass)
274
        obj = js_UnwrapWithObject(cx, obj);
274
        obj = js_UnwrapWithObject(cx, obj);
275
    return js::CallJSPropertyOpSetter(cx, setterOp(), obj, SHAPE_USERID(this), vp);
275
    return js::CallJSPropertyOpSetter(cx, setterOp(), obj, SHAPE_USERID(this), strict, vp);
276
}
276
}
277
277
278
inline
278
inline
(-)a/js/src/jsscript.cpp (-11 / +12 lines)
Line     Link Here 
 Lines 110-116   Bindings::add(JSContext *cx, JSAtom *nam Link Here 
110
    uintN attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED;
110
    uintN attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_SHARED;
111
111
112
    uint16 *indexp;
112
    uint16 *indexp;
113
    PropertyOp getter, setter;
113
    PropertyOp getter;
114
    StrictPropertyOp setter;
114
    uint32 slot = JSObject::CALL_RESERVED_SLOTS;
115
    uint32 slot = JSObject::CALL_RESERVED_SLOTS;
115
116
116
    if (kind == ARGUMENT) {
117
    if (kind == ARGUMENT) {
 Lines 798-817   Class js_ScriptClass = { Link Here 
798
    "Script",
799
    "Script",
799
    JSCLASS_HAS_PRIVATE |
800
    JSCLASS_HAS_PRIVATE |
800
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
801
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
801
    PropertyStub,   /* addProperty */
802
    PropertyStub,         /* addProperty */
802
    PropertyStub,   /* delProperty */
803
    PropertyStub,         /* delProperty */
803
    PropertyStub,   /* getProperty */
804
    PropertyStub,         /* getProperty */
804
    PropertyStub,   /* setProperty */
805
    StrictPropertyStub,   /* setProperty */
805
    EnumerateStub,
806
    EnumerateStub,
806
    ResolveStub,
807
    ResolveStub,
807
    ConvertStub,
808
    ConvertStub,
808
    script_finalize,
809
    script_finalize,
809
    NULL,           /* reserved0   */
810
    NULL,                 /* reserved0   */
810
    NULL,           /* checkAccess */
811
    NULL,                 /* checkAccess */
811
    NULL,           /* call        */
812
    NULL,                 /* call        */
812
    NULL,           /* construct   */
813
    NULL,                 /* construct   */
813
    NULL,           /* xdrObject   */
814
    NULL,                 /* xdrObject   */
814
    NULL,           /* hasInstance */
815
    NULL,                 /* hasInstance */
815
    JS_CLASS_TRACE(script_trace)
816
    JS_CLASS_TRACE(script_trace)
816
};
817
};
817
818
(-)a/js/src/jsstr.cpp (-4 / +4 lines)
Line     Link Here 
 Lines 661-667   str_enumerate(JSContext *cx, JSObject *o Link Here 
661
        if (!str1)
661
        if (!str1)
662
            return JS_FALSE;
662
            return JS_FALSE;
663
        if (!obj->defineProperty(cx, INT_TO_JSID(i), StringValue(str1),
663
        if (!obj->defineProperty(cx, INT_TO_JSID(i), StringValue(str1),
664
                                 PropertyStub, PropertyStub,
664
                                 PropertyStub, StrictPropertyStub,
665
                                 STRING_ELEMENT_ATTRS)) {
665
                                 STRING_ELEMENT_ATTRS)) {
666
            return JS_FALSE;
666
            return JS_FALSE;
667
        }
667
        }
 Lines 699-708   Class js_StringClass = { Link Here 
699
    js_String_str,
699
    js_String_str,
700
    JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_NEW_RESOLVE |
700
    JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_NEW_RESOLVE |
701
    JSCLASS_HAS_CACHED_PROTO(JSProto_String),
701
    JSCLASS_HAS_CACHED_PROTO(JSProto_String),
702
    PropertyStub,   /* addProperty */
702
    PropertyStub,         /* addProperty */
703
    PropertyStub,   /* delProperty */
703
    PropertyStub,         /* delProperty */
704
    str_getProperty,
704
    str_getProperty,
705
    PropertyStub,   /* setProperty */
705
    StrictPropertyStub,   /* setProperty */
706
    str_enumerate,
706
    str_enumerate,
707
    (JSResolveOp)str_resolve,
707
    (JSResolveOp)str_resolve,
708
    ConvertStub
708
    ConvertStub
(-)a/js/src/jstracer.cpp (-5 / +18 lines)
Line     Link Here 
 Lines 539-545   JSClass jitstats_class = { Link Here 
539
    "jitstats",
539
    "jitstats",
540
    0,
540
    0,
541
    JS_PropertyStub,       JS_PropertyStub,
541
    JS_PropertyStub,       JS_PropertyStub,
542
    jitstats_getProperty,  JS_PropertyStub,
542
    jitstats_getProperty,  JS_StrictPropertyStub,
543
    JS_EnumerateStub,      JS_ResolveStub,
543
    JS_EnumerateStub,      JS_ResolveStub,
544
    JS_ConvertStub,        NULL,
544
    JS_ConvertStub,        NULL,
545
    JSCLASS_NO_OPTIONAL_MEMBERS
545
    JSCLASS_NO_OPTIONAL_MEMBERS
 Lines 11145-11159   TraceRecorder::emitNativePropertyOp(cons Link Here 
11145
    w.stStateField(w.immi(1), nativeVpLen);
11145
    w.stStateField(w.immi(1), nativeVpLen);
11146
11146
11147
    CallInfo* ci = new (traceAlloc()) CallInfo();
11147
    CallInfo* ci = new (traceAlloc()) CallInfo();
11148
    ci->_address = uintptr_t(setflag ? shape->setterOp() : shape->getterOp());
11148
    /* Setters and getters have their initial arguments in common. */
11149
    ci->_typesig = CallInfo::typeSig4(ARGTYPE_I, ARGTYPE_P, ARGTYPE_P, ARGTYPE_P, ARGTYPE_P);
11149
    LIns* possibleArgs[] = { NULL, NULL, w.immpIdGC(SHAPE_USERID(shape)), obj_ins, cx_ins };
11150
    LIns** args;
11151
    if (setflag) {
11152
        ci->_address = uintptr_t(shape->setterOp());
11153
        ci->_typesig = CallInfo::typeSig5(ARGTYPE_I, ARGTYPE_P, ARGTYPE_P, ARGTYPE_P, ARGTYPE_B,
11154
                                          ARGTYPE_P);
11155
        possibleArgs[0] = addr_boxed_val_ins;
11156
        possibleArgs[1] = strictModeCode_ins;
11157
        args = possibleArgs;
11158
    } else {
11159
        ci->_address = uintptr_t(shape->getterOp());
11160
        ci->_typesig = CallInfo::typeSig4(ARGTYPE_I, ARGTYPE_P, ARGTYPE_P, ARGTYPE_P, ARGTYPE_P);
11161
        possibleArgs[1] = addr_boxed_val_ins;
11162
        args = possibleArgs + 1;
11163
    }
11150
    ci->_isPure = 0;
11164
    ci->_isPure = 0;
11151
    ci->_storeAccSet = ACCSET_STORE_ANY;
11165
    ci->_storeAccSet = ACCSET_STORE_ANY;
11152
    ci->_abi = ABI_CDECL;
11166
    ci->_abi = ABI_CDECL;
11153
#ifdef DEBUG
11167
#ifdef DEBUG
11154
    ci->_name = "JSPropertyOp";
11168
    ci->_name = "JSPropertyOp";
11155
#endif
11169
#endif
11156
    LIns* args[] = { addr_boxed_val_ins, w.immpIdGC(SHAPE_USERID(shape)), obj_ins, cx_ins };
11157
    LIns* ok_ins = w.call(ci, args);
11170
    LIns* ok_ins = w.call(ci, args);
11158
11171
11159
    // Cleanup. Immediately clear nativeVp before we might deep bail.
11172
    // Cleanup. Immediately clear nativeVp before we might deep bail.
 Lines 12178-12184   TraceRecorder::addDataProperty(JSObject* Link Here 
12178
12191
12179
    // See comment in TR::nativeSet about why we do not support setting a
12192
    // See comment in TR::nativeSet about why we do not support setting a
12180
    // property that has both a setter and a slot.
12193
    // property that has both a setter and a slot.
12181
    if (clasp->setProperty != Valueify(JS_PropertyStub))
12194
    if (clasp->setProperty != Valueify(JS_StrictPropertyStub))
12182
        RETURN_STOP("set new property with setter and slot");
12195
        RETURN_STOP("set new property with setter and slot");
12183
12196
12184
#ifdef DEBUG
12197
#ifdef DEBUG
(-)a/js/src/jstypedarray.cpp (-20 / +20 lines)
Line     Link Here 
 Lines 642-648   class TypedArrayTemplate Link Here 
642
642
643
    static JSBool
643
    static JSBool
644
    obj_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *v,
644
    obj_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *v,
645
                       PropertyOp getter, PropertyOp setter, uintN attrs)
645
                       PropertyOp getter, StrictPropertyOp setter, uintN attrs)
646
    {
646
    {
647
        if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
647
        if (JSID_IS_ATOM(id, cx->runtime->atomState.lengthAtom))
648
            return true;
648
            return true;
 Lines 1437-1446   TypedArrayTemplate<double>::copyIndexToV Link Here 
1437
Class ArrayBuffer::jsclass = {
1437
Class ArrayBuffer::jsclass = {
1438
    "ArrayBuffer",
1438
    "ArrayBuffer",
1439
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
1439
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
1440
    PropertyStub,   /* addProperty */
1440
    PropertyStub,         /* addProperty */
1441
    PropertyStub,   /* delProperty */
1441
    PropertyStub,         /* delProperty */
1442
    PropertyStub,   /* getProperty */
1442
    PropertyStub,         /* getProperty */
1443
    PropertyStub,   /* setProperty */
1443
    StrictPropertyStub,   /* setProperty */
1444
    EnumerateStub,
1444
    EnumerateStub,
1445
    ResolveStub,
1445
    ResolveStub,
1446
    ConvertStub,
1446
    ConvertStub,
 Lines 1450-1456   Class ArrayBuffer::jsclass = { Link Here 
1450
JSPropertySpec ArrayBuffer::jsprops[] = {
1450
JSPropertySpec ArrayBuffer::jsprops[] = {
1451
    { "byteLength",
1451
    { "byteLength",
1452
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1452
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1453
      Jsvalify(ArrayBuffer::prop_getByteLength), JS_PropertyStub },
1453
      Jsvalify(ArrayBuffer::prop_getByteLength), JS_StrictPropertyStub },
1454
    {0,0,0,0,0}
1454
    {0,0,0,0,0}
1455
};
1455
};
1456
1456
 Lines 1461-1476   JSPropertySpec ArrayBuffer::jsprops[] = Link Here 
1461
JSPropertySpec TypedArray::jsprops[] = {
1461
JSPropertySpec TypedArray::jsprops[] = {
1462
    { js_length_str,
1462
    { js_length_str,
1463
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1463
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1464
      Jsvalify(TypedArray::prop_getLength), JS_PropertyStub },
1464
      Jsvalify(TypedArray::prop_getLength), JS_StrictPropertyStub },
1465
    { "byteLength",
1465
    { "byteLength",
1466
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1466
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1467
      Jsvalify(TypedArray::prop_getByteLength), JS_PropertyStub },
1467
      Jsvalify(TypedArray::prop_getByteLength), JS_StrictPropertyStub },
1468
    { "byteOffset",
1468
    { "byteOffset",
1469
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1469
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1470
      Jsvalify(TypedArray::prop_getByteOffset), JS_PropertyStub },
1470
      Jsvalify(TypedArray::prop_getByteOffset), JS_StrictPropertyStub },
1471
    { "buffer",
1471
    { "buffer",
1472
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1472
      -1, JSPROP_SHARED | JSPROP_PERMANENT | JSPROP_READONLY,
1473
      Jsvalify(TypedArray::prop_getBuffer), JS_PropertyStub },
1473
      Jsvalify(TypedArray::prop_getBuffer), JS_StrictPropertyStub },
1474
    {0,0,0,0,0}
1474
    {0,0,0,0,0}
1475
};
1475
};
1476
1476
 Lines 1489-1498   template<> JSFunctionSpec _typedArray::j Link Here 
1489
{                                                                              \
1489
{                                                                              \
1490
    #_typedArray,                                                              \
1490
    #_typedArray,                                                              \
1491
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray),     \
1491
    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray),     \
1492
    PropertyStub,   /* addProperty */                                          \
1492
    PropertyStub,         /* addProperty */                                    \
1493
    PropertyStub,   /* delProperty */                                          \
1493
    PropertyStub,         /* delProperty */                                    \
1494
    PropertyStub,   /* getProperty */                                          \
1494
    PropertyStub,         /* getProperty */                                    \
1495
    PropertyStub,   /* setProperty */                                          \
1495
    StrictPropertyStub,   /* setProperty */                                    \
1496
    EnumerateStub,                                                             \
1496
    EnumerateStub,                                                             \
1497
    ResolveStub,                                                               \
1497
    ResolveStub,                                                               \
1498
    ConvertStub,                                                               \
1498
    ConvertStub,                                                               \
 Lines 1503-1512   template<> JSFunctionSpec _typedArray::j Link Here 
1503
{                                                                              \
1503
{                                                                              \
1504
    #_typedArray,                                                              \
1504
    #_typedArray,                                                              \
1505
    Class::NON_NATIVE | JSCLASS_HAS_PRIVATE,                                   \
1505
    Class::NON_NATIVE | JSCLASS_HAS_PRIVATE,                                   \
1506
    PropertyStub,   /* addProperty */                                          \
1506
    PropertyStub,         /* addProperty */                                    \
1507
    PropertyStub,   /* delProperty */                                          \
1507
    PropertyStub,         /* delProperty */                                    \
1508
    PropertyStub,   /* getProperty */                                          \
1508
    PropertyStub,         /* getProperty */                                    \
1509
    PropertyStub,   /* setProperty */                                          \
1509
    StrictPropertyStub,   /* setProperty */                                    \
1510
    EnumerateStub,                                                             \
1510
    EnumerateStub,                                                             \
1511
    ResolveStub,                                                               \
1511
    ResolveStub,                                                               \
1512
    ConvertStub,                                                               \
1512
    ConvertStub,                                                               \
 Lines 1549-1559   do { Link Here 
1549
    if (!ctor ||                                                               \
1549
    if (!ctor ||                                                               \
1550
        !JS_DefineProperty(cx, ctor, "BYTES_PER_ELEMENT",                      \
1550
        !JS_DefineProperty(cx, ctor, "BYTES_PER_ELEMENT",                      \
1551
                           INT_TO_JSVAL(sizeof(_typedArray::ThisType)),        \
1551
                           INT_TO_JSVAL(sizeof(_typedArray::ThisType)),        \
1552
                           JS_PropertyStub, JS_PropertyStub,                   \
1552
                           JS_PropertyStub, JS_StrictPropertyStub,             \
1553
                           JSPROP_PERMANENT | JSPROP_READONLY) ||              \
1553
                           JSPROP_PERMANENT | JSPROP_READONLY) ||              \
1554
        !JS_DefineProperty(cx, proto, "BYTES_PER_ELEMENT",                     \
1554
        !JS_DefineProperty(cx, proto, "BYTES_PER_ELEMENT",                     \
1555
                           INT_TO_JSVAL(sizeof(_typedArray::ThisType)),        \
1555
                           INT_TO_JSVAL(sizeof(_typedArray::ThisType)),        \
1556
                           JS_PropertyStub, JS_PropertyStub,                   \
1556
                           JS_PropertyStub, JS_StrictPropertyStub,             \
1557
                           JSPROP_PERMANENT | JSPROP_READONLY))                \
1557
                           JSPROP_PERMANENT | JSPROP_READONLY))                \
1558
    {                                                                          \
1558
    {                                                                          \
1559
        return NULL;                                                           \
1559
        return NULL;                                                           \
(-)a/js/src/jsvalue.h (-27 / +32 lines)
Line     Link Here 
 Lines 893-898   typedef JSBool Link Here 
893
typedef JSBool
893
typedef JSBool
894
(* PropertyOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp);
894
(* PropertyOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp);
895
typedef JSBool
895
typedef JSBool
896
(* StrictPropertyOp)(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp);
897
typedef JSBool
896
(* ConvertOp)(JSContext *cx, JSObject *obj, JSType type, Value *vp);
898
(* ConvertOp)(JSContext *cx, JSObject *obj, JSType type, Value *vp);
897
typedef JSBool
899
typedef JSBool
898
(* NewEnumerateOp)(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
900
(* NewEnumerateOp)(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
 Lines 906-912   typedef JSBool Link Here 
906
(* EqualityOp)(JSContext *cx, JSObject *obj, const Value *v, JSBool *bp);
908
(* EqualityOp)(JSContext *cx, JSObject *obj, const Value *v, JSBool *bp);
907
typedef JSBool
909
typedef JSBool
908
(* DefinePropOp)(JSContext *cx, JSObject *obj, jsid id, const Value *value,
910
(* DefinePropOp)(JSContext *cx, JSObject *obj, jsid id, const Value *value,
909
                 PropertyOp getter, PropertyOp setter, uintN attrs);
911
                 PropertyOp getter, StrictPropertyOp setter, uintN attrs);
910
typedef JSBool
912
typedef JSBool
911
(* PropertyIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);
913
(* PropertyIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Value *vp);
912
typedef JSBool
914
typedef JSBool
 Lines 941-966   class AutoIdVector; Link Here 
941
typedef JSBool
943
typedef JSBool
942
(* FixOp)(JSContext *cx, JSObject *obj, bool *fixed, AutoIdVector *props);
944
(* FixOp)(JSContext *cx, JSObject *obj, bool *fixed, AutoIdVector *props);
943
945
944
static inline Native            Valueify(JSNative f)          { return (Native)f; }
946
static inline Native             Valueify(JSNative f)           { return (Native)f; }
945
static inline JSNative          Jsvalify(Native f)            { return (JSNative)f; }
947
static inline JSNative           Jsvalify(Native f)             { return (JSNative)f; }
946
static inline PropertyOp        Valueify(JSPropertyOp f)      { return (PropertyOp)f; }
948
static inline PropertyOp         Valueify(JSPropertyOp f)       { return (PropertyOp)f; }
947
static inline JSPropertyOp      Jsvalify(PropertyOp f)        { return (JSPropertyOp)f; }
949
static inline JSPropertyOp       Jsvalify(PropertyOp f)         { return (JSPropertyOp)f; }
948
static inline ConvertOp         Valueify(JSConvertOp f)       { return (ConvertOp)f; }
950
static inline StrictPropertyOp   Valueify(JSStrictPropertyOp f) { return (StrictPropertyOp)f; }
949
static inline JSConvertOp       Jsvalify(ConvertOp f)         { return (JSConvertOp)f; }
951
static inline JSStrictPropertyOp Jsvalify(StrictPropertyOp f)   { return (JSStrictPropertyOp)f; }
950
static inline NewEnumerateOp    Valueify(JSNewEnumerateOp f)  { return (NewEnumerateOp)f; }
952
static inline ConvertOp          Valueify(JSConvertOp f)        { return (ConvertOp)f; }
951
static inline JSNewEnumerateOp  Jsvalify(NewEnumerateOp f)    { return (JSNewEnumerateOp)f; }
953
static inline JSConvertOp        Jsvalify(ConvertOp f)          { return (JSConvertOp)f; }
952
static inline HasInstanceOp     Valueify(JSHasInstanceOp f)   { return (HasInstanceOp)f; }
954
static inline NewEnumerateOp     Valueify(JSNewEnumerateOp f)   { return (NewEnumerateOp)f; }
953
static inline JSHasInstanceOp   Jsvalify(HasInstanceOp f)     { return (JSHasInstanceOp)f; }
955
static inline JSNewEnumerateOp   Jsvalify(NewEnumerateOp f)     { return (JSNewEnumerateOp)f; }
954
static inline CheckAccessOp     Valueify(JSCheckAccessOp f)   { return (CheckAccessOp)f; }
956
static inline HasInstanceOp      Valueify(JSHasInstanceOp f)    { return (HasInstanceOp)f; }
955
static inline JSCheckAccessOp   Jsvalify(CheckAccessOp f)     { return (JSCheckAccessOp)f; }
957
static inline JSHasInstanceOp    Jsvalify(HasInstanceOp f)      { return (JSHasInstanceOp)f; }
956
static inline EqualityOp        Valueify(JSEqualityOp f);     /* Same type as JSHasInstanceOp */
958
static inline CheckAccessOp      Valueify(JSCheckAccessOp f)    { return (CheckAccessOp)f; }
957
static inline JSEqualityOp      Jsvalify(EqualityOp f);       /* Same type as HasInstanceOp */
959
static inline JSCheckAccessOp    Jsvalify(CheckAccessOp f)      { return (JSCheckAccessOp)f; }
960
static inline EqualityOp         Valueify(JSEqualityOp f);      /* Same type as JSHasInstanceOp */
961
static inline JSEqualityOp       Jsvalify(EqualityOp f);        /* Same type as HasInstanceOp */
958
962
959
static const PropertyOp    PropertyStub  = (PropertyOp)JS_PropertyStub;
963
static const PropertyOp       PropertyStub       = (PropertyOp)JS_PropertyStub;
960
static const JSEnumerateOp EnumerateStub = JS_EnumerateStub;
964
static const StrictPropertyOp StrictPropertyStub = (StrictPropertyOp)JS_StrictPropertyStub;
961
static const JSResolveOp   ResolveStub   = JS_ResolveStub;
965
static const JSEnumerateOp    EnumerateStub      = JS_EnumerateStub;
962
static const ConvertOp     ConvertStub   = (ConvertOp)JS_ConvertStub;
966
static const JSResolveOp      ResolveStub        = JS_ResolveStub;
963
static const JSFinalizeOp  FinalizeStub  = JS_FinalizeStub;
967
static const ConvertOp        ConvertStub        = (ConvertOp)JS_ConvertStub;
968
static const JSFinalizeOp     FinalizeStub       = JS_FinalizeStub;
964
969
965
#define JS_CLASS_MEMBERS                                                      \
970
#define JS_CLASS_MEMBERS                                                      \
966
    const char          *name;                                                \
971
    const char          *name;                                                \
 Lines 970-976   static const JSFinalizeOp FinalizeStub Link Here 
970
    PropertyOp          addProperty;                                          \
975
    PropertyOp          addProperty;                                          \
971
    PropertyOp          delProperty;                                          \
976
    PropertyOp          delProperty;                                          \
972
    PropertyOp          getProperty;                                          \
977
    PropertyOp          getProperty;                                          \
973
    PropertyOp          setProperty;                                          \
978
    StrictPropertyOp    setProperty;                                          \
974
    JSEnumerateOp       enumerate;                                            \
979
    JSEnumerateOp       enumerate;                                            \
975
    JSResolveOp         resolve;                                              \
980
    JSResolveOp         resolve;                                              \
976
    ConvertOp           convert;                                              \
981
    ConvertOp           convert;                                              \
 Lines 1057-1068   JS_STATIC_ASSERT(offsetof(JSClass, mark) Link Here 
1057
JS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));
1062
JS_STATIC_ASSERT(sizeof(JSClass) == sizeof(Class));
1058
1063
1059
struct PropertyDescriptor {
1064
struct PropertyDescriptor {
1060
    JSObject     *obj;
1065
    JSObject           *obj;
1061
    uintN        attrs;
1066
    uintN              attrs;
1062
    PropertyOp   getter;
1067
    PropertyOp         getter;
1063
    PropertyOp   setter;
1068
    StrictPropertyOp   setter;
1064
    Value        value;
1069
    Value              value;
1065
    uintN        shortid;
1070
    uintN              shortid;
1066
};
1071
};
1067
JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, obj) == offsetof(PropertyDescriptor, obj));
1072
JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, obj) == offsetof(PropertyDescriptor, obj));
1068
JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, attrs) == offsetof(PropertyDescriptor, attrs));
1073
JS_STATIC_ASSERT(offsetof(JSPropertyDescriptor, attrs) == offsetof(PropertyDescriptor, attrs));
(-)a/js/src/jswrapper.cpp (-4 / +8 lines)
Line     Link Here 
 Lines 208-214   JSWrapper::get(JSContext *cx, JSObject * Link Here 
208
}
208
}
209
209
210
bool
210
bool
211
JSWrapper::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp)
211
JSWrapper::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict,
212
               Value *vp)
212
{
213
{
213
    // FIXME (bug 596351): Need deal with strict mode.
214
    // FIXME (bug 596351): Need deal with strict mode.
214
    SET(wrappedObject(wrapper)->setProperty(cx, id, vp, false));
215
    SET(wrappedObject(wrapper)->setProperty(cx, id, vp, false));
 Lines 490-501   JSCrossCompartmentWrapper::get(JSContext Link Here 
490
}
491
}
491
492
492
bool
493
bool
493
JSCrossCompartmentWrapper::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, Value *vp)
494
JSCrossCompartmentWrapper::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
495
                               bool strict, Value *vp)
494
{
496
{
495
    AutoValueRooter tvr(cx, *vp);
497
    AutoValueRooter tvr(cx, *vp);
496
    PIERCE(cx, wrapper, SET,
498
    PIERCE(cx, wrapper, SET,
497
           call.destination->wrap(cx, &receiver) && call.destination->wrapId(cx, &id) && call.destination->wrap(cx, tvr.addr()),
499
           call.destination->wrap(cx, &receiver) &&
498
           JSWrapper::set(cx, wrapper, receiver, id, tvr.addr()),
500
           call.destination->wrapId(cx, &id) &&
501
           call.destination->wrap(cx, tvr.addr()),
502
           JSWrapper::set(cx, wrapper, receiver, id, strict, tvr.addr()),
499
           NOTHING);
503
           NOTHING);
500
}
504
}
501
505
(-)a/js/src/jswrapper.h (-2 / +4 lines)
Line     Link Here 
 Lines 75-81   class JS_FRIEND_API(JSWrapper) : public Link Here 
75
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
75
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
76
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
76
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
77
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
77
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
78
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
78
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict,
79
                     js::Value *vp);
79
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
80
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
80
    virtual bool iterate(JSContext *cx, JSObject *wrapper, uintN flags, js::Value *vp);
81
    virtual bool iterate(JSContext *cx, JSObject *wrapper, uintN flags, js::Value *vp);
81
82
 Lines 137-143   class JS_FRIEND_API(JSCrossCompartmentWr Link Here 
137
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
138
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
138
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
139
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
139
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
140
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
140
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, js::Value *vp);
141
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id, bool strict,
142
                     js::Value *vp);
141
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
143
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
142
    virtual bool iterate(JSContext *cx, JSObject *wrapper, uintN flags, js::Value *vp);
144
    virtual bool iterate(JSContext *cx, JSObject *wrapper, uintN flags, js::Value *vp);
143
145
(-)a/js/src/jsxml.cpp (-68 / +68 lines)
Line     Link Here 
 Lines 225-251   JS_FRIEND_DATA(Class) js_NamespaceClass Link Here 
225
    JSCLASS_CONSTRUCT_PROTOTYPE |
225
    JSCLASS_CONSTRUCT_PROTOTYPE |
226
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::NAMESPACE_CLASS_RESERVED_SLOTS) |
226
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::NAMESPACE_CLASS_RESERVED_SLOTS) |
227
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Namespace),
227
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_Namespace),
228
    PropertyStub,   /* addProperty */
228
    PropertyStub,         /* addProperty */
229
    PropertyStub,   /* delProperty */
229
    PropertyStub,         /* delProperty */
230
    PropertyStub,   /* getProperty */
230
    PropertyStub,         /* getProperty */
231
    PropertyStub,   /* setProperty */
231
    StrictPropertyStub,   /* setProperty */
232
    EnumerateStub,
232
    EnumerateStub,
233
    ResolveStub,
233
    ResolveStub,
234
    ConvertStub,
234
    ConvertStub,
235
    FinalizeStub,
235
    FinalizeStub,
236
    NULL,           /* reserved0   */
236
    NULL,                 /* reserved0   */
237
    NULL,           /* checkAccess */
237
    NULL,                 /* checkAccess */
238
    NULL,           /* call        */
238
    NULL,                 /* call        */
239
    NULL,           /* construct   */
239
    NULL,                 /* construct   */
240
    NULL,           /* xdrObject   */
240
    NULL,                 /* xdrObject   */
241
    NULL,           /* hasInstance */
241
    NULL,                 /* hasInstance */
242
    NULL,           /* mark        */
242
    NULL,                 /* mark        */
243
    {
243
    {
244
        namespace_equality,
244
        namespace_equality,
245
        NULL,       /* outerObject    */
245
        NULL,             /* outerObject    */
246
        NULL,       /* innerObject    */
246
        NULL,             /* innerObject    */
247
        NULL,       /* iteratorObject */
247
        NULL,             /* iteratorObject */
248
        NULL,       /* wrappedObject  */
248
        NULL,             /* wrappedObject  */
249
    }
249
    }
250
};
250
};
251
251
 Lines 336-362   JS_FRIEND_DATA(Class) js_QNameClass = { Link Here 
336
    JSCLASS_CONSTRUCT_PROTOTYPE |
336
    JSCLASS_CONSTRUCT_PROTOTYPE |
337
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
337
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
338
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_QName),
338
    JSCLASS_MARK_IS_TRACE | JSCLASS_HAS_CACHED_PROTO(JSProto_QName),
339
    PropertyStub,   /* addProperty */
339
    PropertyStub,         /* addProperty */
340
    PropertyStub,   /* delProperty */
340
    PropertyStub,         /* delProperty */
341
    PropertyStub,   /* getProperty */
341
    PropertyStub,         /* getProperty */
342
    PropertyStub,   /* setProperty */
342
    StrictPropertyStub,   /* setProperty */
343
    EnumerateStub,
343
    EnumerateStub,
344
    ResolveStub,
344
    ResolveStub,
345
    ConvertStub,
345
    ConvertStub,
346
    FinalizeStub,
346
    FinalizeStub,
347
    NULL,           /* reserved0   */
347
    NULL,                 /* reserved0   */
348
    NULL,           /* checkAccess */
348
    NULL,                 /* checkAccess */
349
    NULL,           /* call        */
349
    NULL,                 /* call        */
350
    NULL,           /* construct   */
350
    NULL,                 /* construct   */
351
    NULL,           /* xdrObject   */
351
    NULL,                 /* xdrObject   */
352
    NULL,           /* hasInstance */
352
    NULL,                 /* hasInstance */
353
    NULL,           /* mark        */
353
    NULL,                 /* mark        */
354
    {
354
    {
355
        qname_equality,
355
        qname_equality,
356
        NULL,       /* outerObject    */
356
        NULL,             /* outerObject    */
357
        NULL,       /* innerObject    */
357
        NULL,             /* innerObject    */
358
        NULL,       /* iteratorObject */
358
        NULL,             /* iteratorObject */
359
        NULL,       /* wrappedObject  */
359
        NULL,             /* wrappedObject  */
360
    }
360
    }
361
};
361
};
362
362
 Lines 371-380   JS_FRIEND_DATA(Class) js_AttributeNameCl Link Here 
371
    JSCLASS_CONSTRUCT_PROTOTYPE |
371
    JSCLASS_CONSTRUCT_PROTOTYPE |
372
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
372
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
373
    JSCLASS_MARK_IS_TRACE | JSCLASS_IS_ANONYMOUS,
373
    JSCLASS_MARK_IS_TRACE | JSCLASS_IS_ANONYMOUS,
374
    PropertyStub,   /* addProperty */
374
    PropertyStub,         /* addProperty */
375
    PropertyStub,   /* delProperty */
375
    PropertyStub,         /* delProperty */
376
    PropertyStub,   /* getProperty */
376
    PropertyStub,         /* getProperty */
377
    PropertyStub,   /* setProperty */
377
    StrictPropertyStub,   /* setProperty */
378
    EnumerateStub,
378
    EnumerateStub,
379
    ResolveStub,
379
    ResolveStub,
380
    ConvertStub,
380
    ConvertStub,
 Lines 386-395   JS_FRIEND_DATA(Class) js_AnyNameClass = Link Here 
386
    JSCLASS_CONSTRUCT_PROTOTYPE |
386
    JSCLASS_CONSTRUCT_PROTOTYPE |
387
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
387
    JSCLASS_HAS_RESERVED_SLOTS(JSObject::QNAME_CLASS_RESERVED_SLOTS) |
388
    JSCLASS_MARK_IS_TRACE | JSCLASS_IS_ANONYMOUS,
388
    JSCLASS_MARK_IS_TRACE | JSCLASS_IS_ANONYMOUS,
389
    PropertyStub,   /* addProperty */
389
    PropertyStub,         /* addProperty */
390
    PropertyStub,   /* delProperty */
390
    PropertyStub,         /* delProperty */
391
    PropertyStub,   /* getProperty */
391
    PropertyStub,         /* getProperty */
392
    PropertyStub,   /* setProperty */
392
    StrictPropertyStub,   /* setProperty */
393
    EnumerateStub,
393
    EnumerateStub,
394
    ResolveStub,
394
    ResolveStub,
395
    ConvertStub,
395
    ConvertStub,
 Lines 3836-3842   ResolveValue(JSContext *cx, JSXML *list, Link Here 
3836
3836
3837
/* ECMA-357 9.1.1.2 XML [[Put]] and 9.2.1.2 XMLList [[Put]]. */
3837
/* ECMA-357 9.1.1.2 XML [[Put]] and 9.2.1.2 XMLList [[Put]]. */
3838
static JSBool
3838
static JSBool
3839
PutProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
3839
PutProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
3840
{
3840
{
3841
    JSBool ok, primitiveAssign;
3841
    JSBool ok, primitiveAssign;
3842
    enum { OBJ_ROOT, ID_ROOT, VAL_ROOT };
3842
    enum { OBJ_ROOT, ID_ROOT, VAL_ROOT };
 Lines 4051-4057   PutProperty(JSContext *cx, JSObject *obj Link Here 
4051
                parentobj = js_GetXMLObject(cx, parent);
4051
                parentobj = js_GetXMLObject(cx, parent);
4052
                if (!parentobj)
4052
                if (!parentobj)
4053
                    goto bad;
4053
                    goto bad;
4054
                ok = PutProperty(cx, parentobj, id, vp);
4054
                ok = PutProperty(cx, parentobj, id, strict, vp);
4055
                if (!ok)
4055
                if (!ok)
4056
                    goto out;
4056
                    goto out;
4057
4057
 Lines 4163-4169   PutProperty(JSContext *cx, JSObject *obj Link Here 
4163
            if (!kidobj)
4163
            if (!kidobj)
4164
                goto bad;
4164
                goto bad;
4165
            id = ATOM_TO_JSID(cx->runtime->atomState.starAtom);
4165
            id = ATOM_TO_JSID(cx->runtime->atomState.starAtom);
4166
            ok = PutProperty(cx, kidobj, id, vp);
4166
            ok = PutProperty(cx, kidobj, id, strict, vp);
4167
            if (!ok)
4167
            if (!ok)
4168
                goto out;
4168
                goto out;
4169
        }
4169
        }
 Lines 4523-4529   ResolveValue(JSContext *cx, JSXML *list, Link Here 
4523
            return JS_TRUE;
4523
            return JS_TRUE;
4524
        }
4524
        }
4525
        tv = STRING_TO_JSVAL(cx->runtime->emptyString);
4525
        tv = STRING_TO_JSVAL(cx->runtime->emptyString);
4526
        if (!PutProperty(cx, base->object, id, &tv))
4526
        if (!PutProperty(cx, base->object, id, false, &tv))
4527
            return JS_FALSE;
4527
            return JS_FALSE;
4528
        if (!GetProperty(cx, base->object, id, &tv))
4528
        if (!GetProperty(cx, base->object, id, &tv))
4529
            return JS_FALSE;
4529
            return JS_FALSE;
 Lines 4737-4743   xml_lookupProperty(JSContext *cx, JSObje Link Here 
4737
4737
4738
static JSBool
4738
static JSBool
4739
xml_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *v,
4739
xml_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *v,
4740
                   PropertyOp getter, PropertyOp setter, uintN attrs)
4740
                   PropertyOp getter, StrictPropertyOp setter, uintN attrs)
4741
{
4741
{
4742
    if (IsFunctionObject(*v) || getter || setter ||
4742
    if (IsFunctionObject(*v) || getter || setter ||
4743
        (attrs & JSPROP_ENUMERATE) == 0 ||
4743
        (attrs & JSPROP_ENUMERATE) == 0 ||
 Lines 4746-4752   xml_defineProperty(JSContext *cx, JSObje Link Here 
4746
    }
4746
    }
4747
4747
4748
    jsval tmp = Jsvalify(*v);
4748
    jsval tmp = Jsvalify(*v);
4749
    return PutProperty(cx, obj, id, &tmp);
4749
    return PutProperty(cx, obj, id, false, &tmp);
4750
}
4750
}
4751
4751
4752
static JSBool
4752
static JSBool
 Lines 4763-4769   xml_getProperty(JSContext *cx, JSObject Link Here 
4763
static JSBool
4763
static JSBool
4764
xml_setProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
4764
xml_setProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict)
4765
{
4765
{
4766
    return PutProperty(cx, obj, id, Jsvalify(vp));
4766
    return PutProperty(cx, obj, id, strict, Jsvalify(vp));
4767
}
4767
}
4768
4768
4769
static JSBool
4769
static JSBool
 Lines 5113-5131   JS_FRIEND_DATA(Class) js_XMLClass = { Link Here 
5113
    js_XML_str,
5113
    js_XML_str,
5114
    JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE |
5114
    JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE |
5115
    JSCLASS_HAS_CACHED_PROTO(JSProto_XML),
5115
    JSCLASS_HAS_CACHED_PROTO(JSProto_XML),
5116
    PropertyStub,   /* addProperty */
5116
    PropertyStub,         /* addProperty */
5117
    PropertyStub,   /* delProperty */
5117
    PropertyStub,         /* delProperty */
5118
    PropertyStub,   /* getProperty */
5118
    PropertyStub,         /* getProperty */
5119
    PropertyStub,   /* setProperty */
5119
    StrictPropertyStub,   /* setProperty */
5120
    EnumerateStub,
5120
    EnumerateStub,
5121
    ResolveStub,
5121
    ResolveStub,
5122
    xml_convert,
5122
    xml_convert,
5123
    xml_finalize,
5123
    xml_finalize,
5124
    NULL,           /* reserved0   */
5124
    NULL,                 /* reserved0   */
5125
    NULL,           /* checkAccess */
5125
    NULL,                 /* checkAccess */
5126
    NULL,           /* call        */
5126
    NULL,                 /* call        */
5127
    NULL,           /* construct   */
5127
    NULL,                 /* construct   */
5128
    NULL,           /* xdrObject   */
5128
    NULL,                 /* xdrObject   */
5129
    xml_hasInstance,
5129
    xml_hasInstance,
5130
    JS_CLASS_TRACE(xml_trace),
5130
    JS_CLASS_TRACE(xml_trace),
5131
    JS_NULL_CLASS_EXT,
5131
    JS_NULL_CLASS_EXT,
 Lines 5250-5256   xml_appendChild(JSContext *cx, uintN arg Link Here 
5250
        return JS_FALSE;
5250
        return JS_FALSE;
5251
    *vp = (argc != 0) ? vp[2] : JSVAL_VOID;
5251
    *vp = (argc != 0) ? vp[2] : JSVAL_VOID;
5252
5252
5253
    if (!PutProperty(cx, JSVAL_TO_OBJECT(v), name, vp))
5253
    if (!PutProperty(cx, JSVAL_TO_OBJECT(v), name, false, vp))
5254
        return JS_FALSE;
5254
        return JS_FALSE;
5255
5255
5256
    *vp = OBJECT_TO_JSVAL(obj);
5256
    *vp = OBJECT_TO_JSVAL(obj);
 Lines 6397-6403   xml_setChildren(JSContext *cx, uintN arg Link Here 
6397
        return JS_FALSE;
6397
        return JS_FALSE;
6398
6398
6399
    *vp = argc != 0 ? vp[2] : JSVAL_VOID;     /* local root */
6399
    *vp = argc != 0 ? vp[2] : JSVAL_VOID;     /* local root */
6400
    if (!PutProperty(cx, obj, ATOM_TO_JSID(cx->runtime->atomState.starAtom), vp))
6400
    if (!PutProperty(cx, obj, ATOM_TO_JSID(cx->runtime->atomState.starAtom), false, vp))
6401
        return JS_FALSE;
6401
        return JS_FALSE;
6402
6402
6403
    *vp = OBJECT_TO_JSVAL(obj);
6403
    *vp = OBJECT_TO_JSVAL(obj);
 Lines 7240-7246   js_GetDefaultXMLNamespace(JSContext *cx, Link Here 
7240
        return JS_FALSE;
7240
        return JS_FALSE;
7241
    v = OBJECT_TO_JSVAL(ns);
7241
    v = OBJECT_TO_JSVAL(ns);
7242
    if (!obj->defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, Valueify(v),
7242
    if (!obj->defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, Valueify(v),
7243
                             PropertyStub, PropertyStub, JSPROP_PERMANENT)) {
7243
                             PropertyStub, StrictPropertyStub, JSPROP_PERMANENT)) {
7244
        return JS_FALSE;
7244
        return JS_FALSE;
7245
    }
7245
    }
7246
    *vp = v;
7246
    *vp = v;
 Lines 7260-7266   js_SetDefaultXMLNamespace(JSContext *cx, Link Here 
7260
    JSStackFrame *fp = js_GetTopStackFrame(cx);
7260
    JSStackFrame *fp = js_GetTopStackFrame(cx);
7261
    JSObject &varobj = fp->varobj(cx);
7261
    JSObject &varobj = fp->varobj(cx);
7262
    if (!varobj.defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, ObjectValue(*ns),
7262
    if (!varobj.defineProperty(cx, JS_DEFAULT_XML_NAMESPACE_ID, ObjectValue(*ns),
7263
                               PropertyStub, PropertyStub, JSPROP_PERMANENT)) {
7263
                               PropertyStub, StrictPropertyStub, JSPROP_PERMANENT)) {
7264
        return JS_FALSE;
7264
        return JS_FALSE;
7265
    }
7265
    }
7266
    return JS_TRUE;
7266
    return JS_TRUE;
 Lines 7554-7573   xmlfilter_finalize(JSContext *cx, JSObje Link Here 
7554
Class js_XMLFilterClass = {
7554
Class js_XMLFilterClass = {
7555
    "XMLFilter",
7555
    "XMLFilter",
7556
    JSCLASS_HAS_PRIVATE | JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
7556
    JSCLASS_HAS_PRIVATE | JSCLASS_IS_ANONYMOUS | JSCLASS_MARK_IS_TRACE,
7557
    PropertyStub,   /* addProperty */
7557
    PropertyStub,         /* addProperty */
7558
    PropertyStub,   /* delProperty */
7558
    PropertyStub,         /* delProperty */
7559
    PropertyStub,   /* getProperty */
7559
    PropertyStub,         /* getProperty */
7560
    PropertyStub,   /* setProperty */
7560
    StrictPropertyStub,   /* setProperty */
7561
    EnumerateStub,
7561
    EnumerateStub,
7562
    ResolveStub,
7562
    ResolveStub,
7563
    ConvertStub,
7563
    ConvertStub,
7564
    xmlfilter_finalize,
7564
    xmlfilter_finalize,
7565
    NULL,           /* reserved0   */
7565
    NULL,                 /* reserved0   */
7566
    NULL,           /* checkAccess */
7566
    NULL,                 /* checkAccess */
7567
    NULL,           /* call        */
7567
    NULL,                 /* call        */
7568
    NULL,           /* construct   */
7568
    NULL,                 /* construct   */
7569
    NULL,           /* xdrObject   */
7569
    NULL,                 /* xdrObject   */
7570
    NULL,           /* hasInstance */
7570
    NULL,                 /* hasInstance */
7571
    JS_CLASS_TRACE(xmlfilter_trace)
7571
    JS_CLASS_TRACE(xmlfilter_trace)
7572
};
7572
};
7573
7573
(-)a/js/src/methodjit/PolyIC.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 485-491   class SetPropCompiler : public PICStubCo Link Here 
485
485
486
        Class *clasp = obj->getClass();
486
        Class *clasp = obj->getClass();
487
487
488
        if (clasp->setProperty != PropertyStub)
488
        if (clasp->setProperty != StrictPropertyStub)
489
            return disable("set property hook");
489
            return disable("set property hook");
490
        if (clasp->ops.lookupProperty)
490
        if (clasp->ops.lookupProperty)
491
            return disable("ops lookup property hook");
491
            return disable("ops lookup property hook");
(-)a/js/src/methodjit/StubCalls-inl.h (-2 / +2 lines)
Line     Link Here 
 Lines 70-76   ReportAtomNotDefined(JSContext *cx, JSAt Link Here 
70
        js_ReportIsNotDefined(cx, printable.ptr());
70
        js_ReportIsNotDefined(cx, printable.ptr());
71
}
71
}
72
72
73
#define NATIVE_SET(cx,obj,shape,entry,vp)                                     \
73
#define NATIVE_SET(cx,obj,shape,entry,strict,vp)                              \
74
    JS_BEGIN_MACRO                                                            \
74
    JS_BEGIN_MACRO                                                            \
75
        if (shape->hasDefaultSetter() &&                                      \
75
        if (shape->hasDefaultSetter() &&                                      \
76
            (shape)->slot != SHAPE_INVALID_SLOT &&                            \
76
            (shape)->slot != SHAPE_INVALID_SLOT &&                            \
 Lines 78-84   ReportAtomNotDefined(JSContext *cx, JSAt Link Here 
78
            /* Fast path for, e.g., plain Object instance properties. */      \
78
            /* Fast path for, e.g., plain Object instance properties. */      \
79
            (obj)->nativeSetSlot((shape)->slot, *vp);                         \
79
            (obj)->nativeSetSlot((shape)->slot, *vp);                         \
80
        } else {                                                              \
80
        } else {                                                              \
81
            if (!js_NativeSet(cx, obj, shape, false, vp))                     \
81
            if (!js_NativeSet(cx, obj, shape, false, strict, vp))             \
82
                THROW();                                                      \
82
                THROW();                                                      \
83
        }                                                                     \
83
        }                                                                     \
84
    JS_END_MACRO
84
    JS_END_MACRO
(-)a/js/src/methodjit/StubCalls.cpp (-6 / +6 lines)
Line     Link Here 
 Lines 188-194   stubs::SetName(VMFrame &f, JSAtom *origA Link Here 
188
188
189
                    PCMETER(cache->pchits++);
189
                    PCMETER(cache->pchits++);
190
                    PCMETER(cache->setpchits++);
190
                    PCMETER(cache->setpchits++);
191
                    NATIVE_SET(cx, obj, shape, entry, &rval);
191
                    NATIVE_SET(cx, obj, shape, entry, strict, &rval);
192
                    break;
192
                    break;
193
                }
193
                }
194
            } else {
194
            } else {
 Lines 772-778   stubs::DefFun(VMFrame &f, JSFunction *fu Link Here 
772
    do {
772
    do {
773
        /* Steps 5d, 5f. */
773
        /* Steps 5d, 5f. */
774
        if (!prop || pobj != parent) {
774
        if (!prop || pobj != parent) {
775
            if (!parent->defineProperty(cx, id, rval, PropertyStub, PropertyStub, attrs))
775
            if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
776
                THROW();
776
                THROW();
777
            break;
777
            break;
778
        }
778
        }
 Lines 782-788   stubs::DefFun(VMFrame &f, JSFunction *fu Link Here 
782
        Shape *shape = reinterpret_cast<Shape *>(prop);
782
        Shape *shape = reinterpret_cast<Shape *>(prop);
783
        if (parent->isGlobal()) {
783
        if (parent->isGlobal()) {
784
            if (shape->configurable()) {
784
            if (shape->configurable()) {
785
                if (!parent->defineProperty(cx, id, rval, PropertyStub, PropertyStub, attrs))
785
                if (!parent->defineProperty(cx, id, rval, PropertyStub, StrictPropertyStub, attrs))
786
                    THROW();
786
                    THROW();
787
                break;
787
                break;
788
            }
788
            }
 Lines 2611-2618   stubs::DefVarOrConst(VMFrame &f, JSAtom Link Here 
2611
2611
2612
    /* Bind a variable only if it's not yet defined. */
2612
    /* Bind a variable only if it's not yet defined. */
2613
    if (!prop) {
2613
    if (!prop) {
2614
        if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(), PropertyStub, PropertyStub,
2614
        if (!js_DefineNativeProperty(cx, obj, id, UndefinedValue(),
2615
                                     attrs, 0, 0, &prop)) {
2615
                                     PropertyStub, StrictPropertyStub, attrs, 0, 0, &prop)) {
2616
            THROW();
2616
            THROW();
2617
        }
2617
        }
2618
        JS_ASSERT(prop);
2618
        JS_ASSERT(prop);
 Lines 2629-2635   stubs::SetConst(VMFrame &f, JSAtom *atom Link Here 
2629
    JSObject *obj = &fp->varobj(cx);
2629
    JSObject *obj = &fp->varobj(cx);
2630
    const Value &ref = f.regs.sp[-1];
2630
    const Value &ref = f.regs.sp[-1];
2631
    if (!obj->defineProperty(cx, ATOM_TO_JSID(atom), ref,
2631
    if (!obj->defineProperty(cx, ATOM_TO_JSID(atom), ref,
2632
                             PropertyStub, PropertyStub,
2632
                             PropertyStub, StrictPropertyStub,
2633
                             JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
2633
                             JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY)) {
2634
        THROW();
2634
        THROW();
2635
    }
2635
    }
(-)a/js/src/perf/jsperf.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 216-222   static const struct pm_const { Link Here 
216
216
217
static JSClass pm_class = {
217
static JSClass pm_class = {
218
    "PerfMeasurement", JSCLASS_HAS_PRIVATE,
218
    "PerfMeasurement", JSCLASS_HAS_PRIVATE,
219
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
219
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
220
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize,
220
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize,
221
    JSCLASS_NO_OPTIONAL_MEMBERS
221
    JSCLASS_NO_OPTIONAL_MEMBERS
222
};
222
};
 Lines 265-271   RegisterPerfMeasurement(JSContext *cx, J Link Here 
265
265
266
    for (const pm_const *c = pm_consts; c->name; c++) {
266
    for (const pm_const *c = pm_consts; c->name; c++) {
267
        if (!JS_DefineProperty(cx, ctor, c->name, INT_TO_JSVAL(c->value),
267
        if (!JS_DefineProperty(cx, ctor, c->name, INT_TO_JSVAL(c->value),
268
                               JS_PropertyStub, JS_PropertyStub, PM_CATTRS))
268
                               JS_PropertyStub, JS_StrictPropertyStub, PM_CATTRS))
269
            return 0;
269
            return 0;
270
    }
270
    }
271
271
(-)a/js/src/shell/js.cpp (-10 / +10 lines)
Line     Link Here 
 Lines 1587-1596   finalize_counter_finalize(JSContext *cx, Link Here 
1587
1587
1588
static JSClass FinalizeCounterClass = {
1588
static JSClass FinalizeCounterClass = {
1589
    "FinalizeCounter", JSCLASS_IS_ANONYMOUS,
1589
    "FinalizeCounter", JSCLASS_IS_ANONYMOUS,
1590
    JS_PropertyStub,   /* addProperty */
1590
    JS_PropertyStub,       /* addProperty */
1591
    JS_PropertyStub,   /* delProperty */
1591
    JS_PropertyStub,       /* delProperty */
1592
    JS_PropertyStub,   /* getProperty */
1592
    JS_PropertyStub,       /* getProperty */
1593
    JS_PropertyStub,   /* setProperty */
1593
    JS_StrictPropertyStub, /* setProperty */
1594
    JS_EnumerateStub,
1594
    JS_EnumerateStub,
1595
    JS_ResolveStub,
1595
    JS_ResolveStub,
1596
    JS_ConvertStub,
1596
    JS_ConvertStub,
 Lines 2947-2953   split_getProperty(JSContext *cx, JSObjec Link Here 
2947
}
2947
}
2948
2948
2949
static JSBool
2949
static JSBool
2950
split_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
2950
split_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
2951
{
2951
{
2952
    ComplexObject *cpx;
2952
    ComplexObject *cpx;
2953
2953
 Lines 3319-3325   static JSClass sandbox_class = { Link Here 
3319
    "sandbox",
3319
    "sandbox",
3320
    JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS,
3320
    JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS,
3321
    JS_PropertyStub,   JS_PropertyStub,
3321
    JS_PropertyStub,   JS_PropertyStub,
3322
    JS_PropertyStub,   JS_PropertyStub,
3322
    JS_PropertyStub,   JS_StrictPropertyStub,
3323
    sandbox_enumerate, (JSResolveOp)sandbox_resolve,
3323
    sandbox_enumerate, (JSResolveOp)sandbox_resolve,
3324
    JS_ConvertStub,    NULL,
3324
    JS_ConvertStub,    NULL,
3325
    JSCLASS_NO_OPTIONAL_MEMBERS
3325
    JSCLASS_NO_OPTIONAL_MEMBERS
 Lines 4693-4699   its_getter(JSContext *cx, JSObject *obj, Link Here 
4693
}
4693
}
4694
4694
4695
static JSBool
4695
static JSBool
4696
its_setter(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
4696
its_setter(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
4697
{
4697
{
4698
  jsval *val = (jsval *) JS_GetPrivate(cx, obj);
4698
  jsval *val = (jsval *) JS_GetPrivate(cx, obj);
4699
  if (val) {
4699
  if (val) {
 Lines 4858-4864   its_getProperty(JSContext *cx, JSObject Link Here 
4858
}
4858
}
4859
4859
4860
static JSBool
4860
static JSBool
4861
its_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
4861
its_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
4862
{
4862
{
4863
    IdToString idString(cx, id);
4863
    IdToString idString(cx, id);
4864
    if (its_noisy) {
4864
    if (its_noisy) {
 Lines 5214-5227   global_resolve(JSContext *cx, JSObject * Link Here 
5214
JSClass global_class = {
5214
JSClass global_class = {
5215
    "global", JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE,
5215
    "global", JSCLASS_NEW_RESOLVE | JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE,
5216
    JS_PropertyStub,  JS_PropertyStub,
5216
    JS_PropertyStub,  JS_PropertyStub,
5217
    JS_PropertyStub,  JS_PropertyStub,
5217
    JS_PropertyStub,  JS_StrictPropertyStub,
5218
    global_enumerate, (JSResolveOp) global_resolve,
5218
    global_enumerate, (JSResolveOp) global_resolve,
5219
    JS_ConvertStub,   its_finalize,
5219
    JS_ConvertStub,   its_finalize,
5220
    JSCLASS_NO_OPTIONAL_MEMBERS
5220
    JSCLASS_NO_OPTIONAL_MEMBERS
5221
};
5221
};
5222
5222
5223
static JSBool
5223
static JSBool
5224
env_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
5224
env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
5225
{
5225
{
5226
/* XXX porting may be easy, but these don't seem to supply setenv by default */
5226
/* XXX porting may be easy, but these don't seem to supply setenv by default */
5227
#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS
5227
#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS
(-)a/js/src/jsapi.h (-6 / +6 lines)
Line     Link Here 
 Lines 2268-2279   JS_LookupPropertyWithFlagsById(JSContext Link Here 
2268
                               uintN flags, JSObject **objp, jsval *vp);
2268
                               uintN flags, JSObject **objp, jsval *vp);
2269
2269
2270
struct JSPropertyDescriptor {
2270
struct JSPropertyDescriptor {
2271
    JSObject     *obj;
2271
    JSObject           *obj;
2272
    uintN        attrs;
2272
    uintN              attrs;
2273
    JSPropertyOp getter;
2273
    JSPropertyOp       getter;
2274
    JSPropertyOp setter;
2274
    JSStrictPropertyOp setter;
2275
    jsval        value;
2275
    jsval              value;
2276
    uintN        shortid;
2276
    uintN              shortid;
2277
};
2277
};
2278
2278
2279
/*
2279
/*
(-)a/js/src/jsobj.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 6528-6534   js_ReportGetterOnlyAssignment(JSContext Link Here 
6528
}
6528
}
6529
6529
6530
JS_FRIEND_API(JSBool)
6530
JS_FRIEND_API(JSBool)
6531
js_GetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
6531
js_GetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
6532
{
6532
{
6533
    JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_GETTER_ONLY);
6533
    JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_GETTER_ONLY);
6534
    return JS_FALSE;
6534
    return JS_FALSE;
(-)a/js/src/jsobj.h (-1 / +7 lines)
Line     Link Here 
 Lines 92-97   CastAsJSPropertyOp(JSObject *object) Link Here 
92
    return JS_DATA_TO_FUNC_PTR(JSPropertyOp, object);
92
    return JS_DATA_TO_FUNC_PTR(JSPropertyOp, object);
93
}
93
}
94
94
95
static inline JSStrictPropertyOp
96
CastAsJSStrictPropertyOp(JSObject *object)
97
{
98
    return JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, object);
99
}
100
95
inline JSObject *
101
inline JSObject *
96
CastAsObject(PropertyOp op)
102
CastAsObject(PropertyOp op)
97
{
103
{
 Lines 1845-1851   extern JSBool Link Here 
1845
js_ReportGetterOnlyAssignment(JSContext *cx);
1851
js_ReportGetterOnlyAssignment(JSContext *cx);
1846
1852
1847
extern JS_FRIEND_API(JSBool)
1853
extern JS_FRIEND_API(JSBool)
1848
js_GetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
1854
js_GetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
1849
1855
1850
#ifdef DEBUG
1856
#ifdef DEBUG
1851
JS_FRIEND_API(void) js_DumpChars(const jschar *s, size_t n);
1857
JS_FRIEND_API(void) js_DumpChars(const jschar *s, size_t n);
(-)a/js/src/shell/jsworkers.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 1237-1243   Event::trace(JSTracer *trc) Link Here 
1237
1237
1238
JSClass ThreadPool::jsClass = {
1238
JSClass ThreadPool::jsClass = {
1239
    "ThreadPool", JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
1239
    "ThreadPool", JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
1240
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
1240
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
1241
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, jsFinalize,
1241
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, jsFinalize,
1242
    NULL, NULL, NULL, NULL,
1242
    NULL, NULL, NULL, NULL,
1243
    NULL, NULL, JS_CLASS_TRACE(jsTraceThreadPool), NULL
1243
    NULL, NULL, JS_CLASS_TRACE(jsTraceThreadPool), NULL
 Lines 1245-1251   JSClass ThreadPool::jsClass = { Link Here 
1245
1245
1246
JSClass Worker::jsWorkerClass = {
1246
JSClass Worker::jsWorkerClass = {
1247
    "Worker", JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
1247
    "Worker", JSCLASS_HAS_PRIVATE | JSCLASS_MARK_IS_TRACE,
1248
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
1248
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
1249
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, jsFinalize,
1249
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, jsFinalize,
1250
    NULL, NULL, NULL, NULL,
1250
    NULL, NULL, NULL, NULL,
1251
    NULL, NULL, JS_CLASS_TRACE(jsTraceWorker), NULL
1251
    NULL, NULL, JS_CLASS_TRACE(jsTraceWorker), NULL

Return to bug 537873