Attachment #509033: Add 'strict' argument to setters defined throughout Firefox. for bug #537873

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

(-)a/content/canvas/src/CustomQS_Canvas2D.h (-2 / +2 lines)
Line     Link Here 
 Lines 130-136   Canvas2D_GetStyleHelper(JSContext *cx, J Link Here 
130
}
130
}
131
131
132
static JSBool
132
static JSBool
133
nsIDOMCanvasRenderingContext2D_SetStrokeStyle(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
133
nsIDOMCanvasRenderingContext2D_SetStrokeStyle(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
134
{
134
{
135
    return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetStrokeStyle_multi);
135
    return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetStrokeStyle_multi);
136
}
136
}
 Lines 142-148   nsIDOMCanvasRenderingContext2D_GetStroke Link Here 
142
}
142
}
143
143
144
static JSBool
144
static JSBool
145
nsIDOMCanvasRenderingContext2D_SetFillStyle(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
145
nsIDOMCanvasRenderingContext2D_SetFillStyle(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
146
{
146
{
147
    return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetFillStyle_multi);
147
    return Canvas2D_SetStyleHelper(cx, obj, id, vp, &nsIDOMCanvasRenderingContext2D::SetFillStyle_multi);
148
}
148
}
(-)a/content/xbl/src/nsXBLBinding.cpp (-1 / +2 lines)
Line     Link Here 
 Lines 233-239   nsXBLJSClass::nsXBLJSClass(const nsAFlat Link Here 
233
    JSCLASS_NEW_RESOLVE | JSCLASS_NEW_RESOLVE_GETS_START |
233
    JSCLASS_NEW_RESOLVE | JSCLASS_NEW_RESOLVE_GETS_START |
234
    // Our one reserved slot holds the relevant nsXBLPrototypeBinding
234
    // Our one reserved slot holds the relevant nsXBLPrototypeBinding
235
    JSCLASS_HAS_RESERVED_SLOTS(1);
235
    JSCLASS_HAS_RESERVED_SLOTS(1);
236
  addProperty = delProperty = setProperty = getProperty = ::JS_PropertyStub;
236
  addProperty = delProperty = getProperty = ::JS_PropertyStub;
237
  setProperty = ::JS_StrictPropertyStub;
237
  enumerate = ::JS_EnumerateStub;
238
  enumerate = ::JS_EnumerateStub;
238
  resolve = (JSResolveOp)XBLResolve;
239
  resolve = (JSResolveOp)XBLResolve;
239
  convert = ::JS_ConvertStub;
240
  convert = ::JS_ConvertStub;
(-)a/content/xbl/src/nsXBLDocumentInfo.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 138-144   nsXBLDocGlobalObject_getProperty(JSConte Link Here 
138
138
139
static JSBool
139
static JSBool
140
nsXBLDocGlobalObject_setProperty(JSContext *cx, JSObject *obj,
140
nsXBLDocGlobalObject_setProperty(JSContext *cx, JSObject *obj,
141
                                 jsid id, jsval *vp)
141
                                 jsid id, JSBool strict, jsval *vp)
142
{
142
{
143
  return nsXBLDocGlobalObject::
143
  return nsXBLDocGlobalObject::
144
    doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
144
    doCheckAccess(cx, obj, id, nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
(-)a/content/xbl/src/nsXBLProtoImplProperty.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 195-201   nsXBLProtoImplProperty::InstallMember(ns Link Here 
195
                               reinterpret_cast<const jschar*>(mName),
195
                               reinterpret_cast<const jschar*>(mName),
196
                               name.Length(), JSVAL_VOID,
196
                               name.Length(), JSVAL_VOID,
197
                               JS_DATA_TO_FUNC_PTR(JSPropertyOp, getter),
197
                               JS_DATA_TO_FUNC_PTR(JSPropertyOp, getter),
198
                               JS_DATA_TO_FUNC_PTR(JSPropertyOp, setter),
198
                               JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, setter),
199
                               mJSAttributes))
199
                               mJSAttributes))
200
      return NS_ERROR_OUT_OF_MEMORY;
200
      return NS_ERROR_OUT_OF_MEMORY;
201
  }
201
  }
(-)a/content/xul/document/src/nsXULPrototypeDocument.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 144-150   nsXULPDGlobalObject_resolve(JSContext *c Link Here 
144
JSClass nsXULPDGlobalObject::gSharedGlobalClass = {
144
JSClass nsXULPDGlobalObject::gSharedGlobalClass = {
145
    "nsXULPrototypeScript compilation scope",
145
    "nsXULPrototypeScript compilation scope",
146
    JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_GLOBAL_FLAGS,
146
    JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_GLOBAL_FLAGS,
147
    JS_PropertyStub,  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
147
    JS_PropertyStub,  JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
148
    JS_EnumerateStub, nsXULPDGlobalObject_resolve,  JS_ConvertStub,
148
    JS_EnumerateStub, nsXULPDGlobalObject_resolve,  JS_ConvertStub,
149
    nsXULPDGlobalObject_finalize
149
    nsXULPDGlobalObject_finalize
150
};
150
};
(-)a/dom/base/nsDOMClassInfo.cpp (-11 / +19 lines)
Line     Link Here 
 Lines 1976-1982   NS_INTERFACE_MAP_END Link Here 
1976
1976
1977
static JSClass sDOMConstructorProtoClass = {
1977
static JSClass sDOMConstructorProtoClass = {
1978
  "DOM Constructor.prototype", 0,
1978
  "DOM Constructor.prototype", 0,
1979
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
1979
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
1980
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nsnull
1980
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nsnull
1981
};
1981
};
1982
1982
 Lines 4997-5004   nsWindowSH::PreCreate(nsISupports *nativ Link Here 
4997
static JSClass sGlobalScopePolluterClass = {
4997
static JSClass sGlobalScopePolluterClass = {
4998
  "Global Scope Polluter",
4998
  "Global Scope Polluter",
4999
  JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE,
4999
  JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE,
5000
  nsWindowSH::SecurityCheckOnSetProp,
5000
  nsWindowSH::SecurityCheckOnAddDelProp,
5001
  nsWindowSH::SecurityCheckOnSetProp,
5001
  nsWindowSH::SecurityCheckOnAddDelProp,
5002
  nsWindowSH::GlobalScopePolluterGetProperty,
5002
  nsWindowSH::GlobalScopePolluterGetProperty,
5003
  nsWindowSH::SecurityCheckOnSetProp,
5003
  nsWindowSH::SecurityCheckOnSetProp,
5004
  JS_EnumerateStub,
5004
  JS_EnumerateStub,
 Lines 5037-5044   nsWindowSH::GlobalScopePolluterGetProper Link Here 
5037
5037
5038
// static
5038
// static
5039
JSBool
5039
JSBool
5040
nsWindowSH::SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsid id,
5040
nsWindowSH::SecurityCheckOnAddDelProp(JSContext *cx, JSObject *obj, jsid id,
5041
                                   jsval *vp)
5041
                                      jsval *vp)
5042
{
5042
{
5043
  // Someone is accessing a element by referencing its name/id in the
5043
  // Someone is accessing a element by referencing its name/id in the
5044
  // global scope, do a security check to make sure that's ok.
5044
  // global scope, do a security check to make sure that's ok.
 Lines 5053-5058   nsWindowSH::SecurityCheckOnSetProp(JSCon Link Here 
5053
  return NS_SUCCEEDED(rv);
5053
  return NS_SUCCEEDED(rv);
5054
}
5054
}
5055
5055
5056
// static
5057
JSBool
5058
nsWindowSH::SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
5059
                                   jsval *vp)
5060
{
5061
  return SecurityCheckOnAddDelProp(cx, obj, id, vp);
5062
}
5063
5056
static nsHTMLDocument*
5064
static nsHTMLDocument*
5057
GetDocument(JSContext *cx, JSObject *obj)
5065
GetDocument(JSContext *cx, JSObject *obj)
5058
{
5066
{
 Lines 6905-6911   nsWindowSH::NewResolve(nsIXPConnectWrapp Link Here 
6905
      JSAutoRequest ar(cx);
6913
      JSAutoRequest ar(cx);
6906
6914
6907
      if (!::JS_DefinePropertyById(cx, obj, id, JSVAL_VOID, JS_PropertyStub,
6915
      if (!::JS_DefinePropertyById(cx, obj, id, JSVAL_VOID, JS_PropertyStub,
6908
                                   JS_PropertyStub, JSPROP_ENUMERATE)) {
6916
                                   JS_StrictPropertyStub, JSPROP_ENUMERATE)) {
6909
        return NS_ERROR_FAILURE;
6917
        return NS_ERROR_FAILURE;
6910
      }
6918
      }
6911
      *objp = obj;
6919
      *objp = obj;
 Lines 7067-7073   nsWindowSH::NewResolve(nsIXPConnectWrapp Link Here 
7067
      if ((!(flags & JSRESOLVE_QUALIFIED) &&
7075
      if ((!(flags & JSRESOLVE_QUALIFIED) &&
7068
           !js_CheckUndeclaredVarAssignment(cx, str)) ||
7076
           !js_CheckUndeclaredVarAssignment(cx, str)) ||
7069
          !::JS_DefinePropertyById(cx, obj, id, JSVAL_VOID, JS_PropertyStub,
7077
          !::JS_DefinePropertyById(cx, obj, id, JSVAL_VOID, JS_PropertyStub,
7070
                                   JS_PropertyStub, JSPROP_ENUMERATE)) {
7078
                                   JS_StrictPropertyStub, JSPROP_ENUMERATE)) {
7071
        *_retval = JS_FALSE;
7079
        *_retval = JS_FALSE;
7072
7080
7073
        return NS_OK;
7081
        return NS_OK;
 Lines 8531-8537   nsDocumentSH::PostCreate(nsIXPConnectWra Link Here 
8531
                               reinterpret_cast<const jschar *>
8539
                               reinterpret_cast<const jschar *>
8532
                                               (doc_str.get()),
8540
                                               (doc_str.get()),
8533
                               doc_str.Length(), OBJECT_TO_JSVAL(obj),
8541
                               doc_str.Length(), OBJECT_TO_JSVAL(obj),
8534
                               JS_PropertyStub, JS_PropertyStub,
8542
                               JS_PropertyStub, JS_StrictPropertyStub,
8535
                               JSPROP_READONLY | JSPROP_ENUMERATE)) {
8543
                               JSPROP_READONLY | JSPROP_ENUMERATE)) {
8536
      return NS_ERROR_FAILURE;
8544
      return NS_ERROR_FAILURE;
8537
    }
8545
    }
 Lines 8646-8652   static JSClass sHTMLDocumentAllClass = { Link Here 
8646
  JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE |
8654
  JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE |
8647
  JSCLASS_HAS_RESERVED_SLOTS(1),
8655
  JSCLASS_HAS_RESERVED_SLOTS(1),
8648
  JS_PropertyStub, JS_PropertyStub, nsHTMLDocumentSH::DocumentAllGetProperty,
8656
  JS_PropertyStub, JS_PropertyStub, nsHTMLDocumentSH::DocumentAllGetProperty,
8649
  JS_PropertyStub, JS_EnumerateStub,
8657
  JS_StrictPropertyStub, JS_EnumerateStub,
8650
  (JSResolveOp)nsHTMLDocumentSH::DocumentAllNewResolve, JS_ConvertStub,
8658
  (JSResolveOp)nsHTMLDocumentSH::DocumentAllNewResolve, JS_ConvertStub,
8651
  nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
8659
  nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
8652
  nsHTMLDocumentSH::CallToGetPropMapper
8660
  nsHTMLDocumentSH::CallToGetPropMapper
 Lines 8657-8663   static JSClass sHTMLDocumentAllHelperCla Link Here 
8657
  "HTML document.all helper class", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE,
8665
  "HTML document.all helper class", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE,
8658
  JS_PropertyStub, JS_PropertyStub,
8666
  JS_PropertyStub, JS_PropertyStub,
8659
  nsHTMLDocumentSH::DocumentAllHelperGetProperty,
8667
  nsHTMLDocumentSH::DocumentAllHelperGetProperty,
8660
  JS_PropertyStub, JS_EnumerateStub,
8668
  JS_StrictPropertyStub, JS_EnumerateStub,
8661
  (JSResolveOp)nsHTMLDocumentSH::DocumentAllHelperNewResolve, JS_ConvertStub,
8669
  (JSResolveOp)nsHTMLDocumentSH::DocumentAllHelperNewResolve, JS_ConvertStub,
8662
  nsnull
8670
  nsnull
8663
};
8671
};
 Lines 8666-8672   static JSClass sHTMLDocumentAllHelperCla Link Here 
8666
static JSClass sHTMLDocumentAllTagsClass = {
8674
static JSClass sHTMLDocumentAllTagsClass = {
8667
  "HTML document.all.tags class",
8675
  "HTML document.all.tags class",
8668
  JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
8676
  JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
8669
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
8677
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
8670
  JS_EnumerateStub, (JSResolveOp)nsHTMLDocumentSH::DocumentAllTagsNewResolve,
8678
  JS_EnumerateStub, (JSResolveOp)nsHTMLDocumentSH::DocumentAllTagsNewResolve,
8671
  JS_ConvertStub, nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
8679
  JS_ConvertStub, nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
8672
  nsHTMLDocumentSH::CallToGetPropMapper
8680
  nsHTMLDocumentSH::CallToGetPropMapper
(-)a/dom/base/nsDOMClassInfo.h (-1 / +3 lines)
Line     Link Here 
 Lines 576-583   public: Link Here 
576
                                              JSObject **objp);
576
                                              JSObject **objp);
577
  static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSObject *obj,
577
  static JSBool GlobalScopePolluterGetProperty(JSContext *cx, JSObject *obj,
578
                                               jsid id, jsval *vp);
578
                                               jsid id, jsval *vp);
579
  static JSBool SecurityCheckOnAddDelProp(JSContext *cx, JSObject *obj, jsid id,
580
                                          jsval *vp);
579
  static JSBool SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsid id,
581
  static JSBool SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsid id,
580
                                       jsval *vp);
582
                                       JSBool strict, jsval *vp);
581
  static void InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
583
  static void InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj);
582
  static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
584
  static nsresult InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
583
                                             nsIHTMLDocument *doc);
585
                                             nsIHTMLDocument *doc);
(-)a/dom/base/nsGlobalWindow.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 2100-2106   nsGlobalWindow::SetNewDocument(nsIDocume Link Here 
2100
    } else {
2100
    } else {
2101
      if (!JS_DefineProperty(cx, newInnerWindow->mJSObject, "window",
2101
      if (!JS_DefineProperty(cx, newInnerWindow->mJSObject, "window",
2102
                             OBJECT_TO_JSVAL(mJSObject),
2102
                             OBJECT_TO_JSVAL(mJSObject),
2103
                             JS_PropertyStub, JS_PropertyStub,
2103
                             JS_PropertyStub, JS_StrictPropertyStub,
2104
                             JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)) {
2104
                             JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT)) {
2105
        NS_ERROR("can't create the 'window' property");
2105
        NS_ERROR("can't create the 'window' property");
2106
        return NS_ERROR_FAILURE;
2106
        return NS_ERROR_FAILURE;
(-)a/dom/base/nsJSEnvironment.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 3203-3209   nsJSContext::ClearScope(void *aGlobalObj Link Here 
3203
3203
3204
    if (window != JSVAL_VOID) {
3204
    if (window != JSVAL_VOID) {
3205
      if (!JS_DefineProperty(mContext, obj, "window", window,
3205
      if (!JS_DefineProperty(mContext, obj, "window", window,
3206
                             JS_PropertyStub, JS_PropertyStub,
3206
                             JS_PropertyStub, JS_StrictPropertyStub,
3207
                             JSPROP_ENUMERATE | JSPROP_READONLY |
3207
                             JSPROP_ENUMERATE | JSPROP_READONLY |
3208
                             JSPROP_PERMANENT)) {
3208
                             JSPROP_PERMANENT)) {
3209
        JS_ClearPendingException(mContext);
3209
        JS_ClearPendingException(mContext);
(-)a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 108-114   static JSObject *autoconfig_glob; Link Here 
108
108
109
static JSClass global_class = {
109
static JSClass global_class = {
110
    "autoconfig_global", JSCLASS_GLOBAL_FLAGS,
110
    "autoconfig_global", JSCLASS_GLOBAL_FLAGS,
111
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,
111
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_StrictPropertyStub,
112
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
112
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
113
};
113
};
114
114
(-)a/js/ipc/ObjectWrapperChild.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 429-435   static const JSClass sCPOW_NewEnumerateS Link Here 
429
    JSCLASS_HAS_PRIVATE |
429
    JSCLASS_HAS_PRIVATE |
430
    JSCLASS_HAS_RESERVED_SLOTS(sNumNewEnumerateStateSlots),
430
    JSCLASS_HAS_RESERVED_SLOTS(sNumNewEnumerateStateSlots),
431
    JS_PropertyStub,  JS_PropertyStub,
431
    JS_PropertyStub,  JS_PropertyStub,
432
    JS_PropertyStub,  JS_PropertyStub,
432
    JS_PropertyStub,  JS_StrictPropertyStub,
433
    JS_EnumerateStub, JS_ResolveStub,
433
    JS_EnumerateStub, JS_ResolveStub,
434
    JS_ConvertStub,   CPOW_NewEnumerateState_Finalize,
434
    JS_ConvertStub,   CPOW_NewEnumerateState_Finalize,
435
    JSCLASS_NO_OPTIONAL_MEMBERS
435
    JSCLASS_NO_OPTIONAL_MEMBERS
(-)a/js/ipc/ObjectWrapperParent.cpp (-3 / +3 lines)
Line     Link Here 
 Lines 177-183   const js::Class ObjectWrapperParent::sCP Link Here 
177
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_AddProperty),
177
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_AddProperty),
178
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_DelProperty),
178
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_DelProperty),
179
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_GetProperty),
179
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_GetProperty),
180
      JS_VALUEIFY(js::PropertyOp, ObjectWrapperParent::CPOW_SetProperty),
180
      JS_VALUEIFY(js::StrictPropertyOp, ObjectWrapperParent::CPOW_SetProperty),
181
      (JSEnumerateOp) ObjectWrapperParent::CPOW_NewEnumerate,
181
      (JSEnumerateOp) ObjectWrapperParent::CPOW_NewEnumerate,
182
      (JSResolveOp) ObjectWrapperParent::CPOW_NewResolve,
182
      (JSResolveOp) ObjectWrapperParent::CPOW_NewResolve,
183
      JS_VALUEIFY(js::ConvertOp, ObjectWrapperParent::CPOW_Convert),
183
      JS_VALUEIFY(js::ConvertOp, ObjectWrapperParent::CPOW_Convert),
 Lines 450-457   ObjectWrapperParent::CPOW_GetProperty(JS Link Here 
450
}
450
}
451
451
452
/*static*/ JSBool
452
/*static*/ JSBool
453
ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSObject *obj, jsid id,
453
ObjectWrapperParent::CPOW_SetProperty(JSContext *cx, JSObject *obj, jsid id, 
454
                                      jsval *vp)
454
                                      JSBool strict, jsval *vp)
455
{
455
{
456
    CPOW_LOG(("Calling CPOW_SetProperty (%s)...",
456
    CPOW_LOG(("Calling CPOW_SetProperty (%s)...",
457
              JSVAL_TO_CSTR(cx, id)));
457
              JSVAL_TO_CSTR(cx, id)));
(-)a/js/ipc/ObjectWrapperParent.h (-1 / +1 lines)
Line     Link Here 
 Lines 98-104   private: Link Here 
98
    CPOW_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
98
    CPOW_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
99
    
99
    
100
    static JSBool
100
    static JSBool
101
    CPOW_SetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
101
    CPOW_SetProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
102
102
103
    JSBool NewEnumerateInit(JSContext* cx, jsval* statep, jsid* idp);
103
    JSBool NewEnumerateInit(JSContext* cx, jsval* statep, jsid* idp);
104
    JSBool NewEnumerateNext(JSContext* cx, jsval* statep, jsid* idp);
104
    JSBool NewEnumerateNext(JSContext* cx, jsval* statep, jsid* idp);
(-)a/js/jetpack/Handle.h (-2 / +2 lines)
Line     Link Here 
 Lines 249-255   private: Link Here 
249
  }
249
  }
250
250
251
  static JSBool
251
  static JSBool
252
  SetIsRooted(JSContext* cx, JSObject* obj, jsid, jsval* vp) {
252
  SetIsRooted(JSContext* cx, JSObject* obj, jsid, JSBool strict, jsval* vp) {
253
    Handle* self = Unwrap(cx, obj);
253
    Handle* self = Unwrap(cx, obj);
254
    JSBool v;
254
    JSBool v;
255
    if (!JS_ValueToBoolean(cx, *vp, &v))
255
    if (!JS_ValueToBoolean(cx, *vp, &v))
 Lines 330-336   const JSClass Link Here 
330
Handle<BaseType>::sHandle_JSClass = {
330
Handle<BaseType>::sHandle_JSClass = {
331
  "IPDL Handle", JSCLASS_HAS_PRIVATE,
331
  "IPDL Handle", JSCLASS_HAS_PRIVATE,
332
  JS_PropertyStub, JS_PropertyStub,
332
  JS_PropertyStub, JS_PropertyStub,
333
  JS_PropertyStub, JS_PropertyStub,
333
  JS_PropertyStub, JS_StrictPropertyStub,
334
  JS_EnumerateStub, JS_ResolveStub,
334
  JS_EnumerateStub, JS_ResolveStub,
335
  JS_ConvertStub, Handle::Finalize,
335
  JS_ConvertStub, Handle::Finalize,
336
  JSCLASS_NO_OPTIONAL_MEMBERS
336
  JSCLASS_NO_OPTIONAL_MEMBERS
(-)a/js/jetpack/JetpackChild.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 86-92   JetpackChild::sImplMethods[] = { Link Here 
86
const JSClass
86
const JSClass
87
JetpackChild::sGlobalClass = {
87
JetpackChild::sGlobalClass = {
88
  "JetpackChild::sGlobalClass", JSCLASS_GLOBAL_FLAGS,
88
  "JetpackChild::sGlobalClass", JSCLASS_GLOBAL_FLAGS,
89
  JS_PropertyStub,  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
89
  JS_PropertyStub,  JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
90
  JS_EnumerateStub, JS_ResolveStub,  JS_ConvertStub,  JS_FinalizeStub,
90
  JS_EnumerateStub, JS_ResolveStub,  JS_ConvertStub,  JS_FinalizeStub,
91
  JSCLASS_NO_OPTIONAL_MEMBERS
91
  JSCLASS_NO_OPTIONAL_MEMBERS
92
};
92
};
(-)a/js/src/ctypes/CTypes.cpp (-20 / +21 lines)
Line     Link Here 
 Lines 107-113   namespace PointerType { Link Here 
107
    jsval* vp);
107
    jsval* vp);
108
  static JSBool ContentsGetter(JSContext* cx, JSObject* obj, jsid idval,
108
  static JSBool ContentsGetter(JSContext* cx, JSObject* obj, jsid idval,
109
    jsval* vp);
109
    jsval* vp);
110
  static JSBool ContentsSetter(JSContext* cx, JSObject* obj, jsid idval,
110
  static JSBool ContentsSetter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict,
111
    jsval* vp);
111
    jsval* vp);
112
  static JSBool IsNull(JSContext* cx, uintN argc, jsval* vp);
112
  static JSBool IsNull(JSContext* cx, uintN argc, jsval* vp);
113
}
113
}
 Lines 121-127   namespace ArrayType { Link Here 
121
  static JSBool LengthGetter(JSContext* cx, JSObject* obj, jsid idval,
121
  static JSBool LengthGetter(JSContext* cx, JSObject* obj, jsid idval,
122
    jsval* vp);
122
    jsval* vp);
123
  static JSBool Getter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp);
123
  static JSBool Getter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp);
124
  static JSBool Setter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp);
124
  static JSBool Setter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict, jsval* vp);
125
  static JSBool AddressOfElement(JSContext* cx, uintN argc, jsval* vp);
125
  static JSBool AddressOfElement(JSContext* cx, uintN argc, jsval* vp);
126
}
126
}
127
127
 Lines 133-140   namespace StructType { Link Here 
133
    jsval* vp);
133
    jsval* vp);
134
  static JSBool FieldGetter(JSContext* cx, JSObject* obj, jsid idval,
134
  static JSBool FieldGetter(JSContext* cx, JSObject* obj, jsid idval,
135
    jsval* vp);
135
    jsval* vp);
136
  static JSBool FieldSetter(JSContext* cx, JSObject* obj, jsid idval,
136
  static JSBool FieldSetter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict,
137
    jsval* vp);
137
                            jsval* vp);
138
  static JSBool AddressOfField(JSContext* cx, uintN argc, jsval* vp);
138
  static JSBool AddressOfField(JSContext* cx, uintN argc, jsval* vp);
139
  static JSBool Define(JSContext* cx, uintN argc, jsval* vp);
139
  static JSBool Define(JSContext* cx, uintN argc, jsval* vp);
140
}
140
}
 Lines 168-176   namespace CData { Link Here 
168
  static void Finalize(JSContext* cx, JSObject* obj);
168
  static void Finalize(JSContext* cx, JSObject* obj);
169
169
170
  static JSBool ValueGetter(JSContext* cx, JSObject* obj, jsid idval,
170
  static JSBool ValueGetter(JSContext* cx, JSObject* obj, jsid idval,
171
    jsval* vp);
171
                            jsval* vp);
172
  static JSBool ValueSetter(JSContext* cx, JSObject* obj, jsid idval,
172
  static JSBool ValueSetter(JSContext* cx, JSObject* obj, jsid idval,
173
    jsval* vp);
173
                            JSBool strict, jsval* vp);
174
  static JSBool Address(JSContext* cx, uintN argc, jsval* vp);
174
  static JSBool Address(JSContext* cx, uintN argc, jsval* vp);
175
  static JSBool ReadString(JSContext* cx, uintN argc, jsval* vp);
175
  static JSBool ReadString(JSContext* cx, uintN argc, jsval* vp);
176
  static JSBool ToSource(JSContext* cx, uintN argc, jsval* vp);
176
  static JSBool ToSource(JSContext* cx, uintN argc, jsval* vp);
 Lines 225-231   namespace UInt64 { Link Here 
225
static JSClass sCTypesGlobalClass = {
225
static JSClass sCTypesGlobalClass = {
226
  "ctypes",
226
  "ctypes",
227
  JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS),
227
  JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS),
228
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
228
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
229
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
229
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
230
  JSCLASS_NO_OPTIONAL_MEMBERS
230
  JSCLASS_NO_OPTIONAL_MEMBERS
231
};
231
};
 Lines 233-239   static JSClass sCTypesGlobalClass = { Link Here 
233
static JSClass sCABIClass = {
233
static JSClass sCABIClass = {
234
  "CABI",
234
  "CABI",
235
  JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS),
235
  JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS),
236
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
236
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
237
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
237
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
238
  JSCLASS_NO_OPTIONAL_MEMBERS
238
  JSCLASS_NO_OPTIONAL_MEMBERS
239
};
239
};
 Lines 244-250   static JSClass sCABIClass = { Link Here 
244
static JSClass sCTypeProtoClass = {
244
static JSClass sCTypeProtoClass = {
245
  "CType",
245
  "CType",
246
  JSCLASS_HAS_RESERVED_SLOTS(CTYPEPROTO_SLOTS),
246
  JSCLASS_HAS_RESERVED_SLOTS(CTYPEPROTO_SLOTS),
247
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
247
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
248
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::FinalizeProtoClass,
248
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::FinalizeProtoClass,
249
  NULL, NULL, ConstructAbstract, ConstructAbstract, NULL, NULL, NULL, NULL
249
  NULL, NULL, ConstructAbstract, ConstructAbstract, NULL, NULL, NULL, NULL
250
};
250
};
 Lines 254-260   static JSClass sCTypeProtoClass = { Link Here 
254
static JSClass sCDataProtoClass = {
254
static JSClass sCDataProtoClass = {
255
  "CData",
255
  "CData",
256
  0,
256
  0,
257
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
257
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
258
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
258
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
259
  JSCLASS_NO_OPTIONAL_MEMBERS
259
  JSCLASS_NO_OPTIONAL_MEMBERS
260
};
260
};
 Lines 262-268   static JSClass sCDataProtoClass = { Link Here 
262
static JSClass sCTypeClass = {
262
static JSClass sCTypeClass = {
263
  "CType",
263
  "CType",
264
  JSCLASS_HAS_RESERVED_SLOTS(CTYPE_SLOTS) | JSCLASS_MARK_IS_TRACE,
264
  JSCLASS_HAS_RESERVED_SLOTS(CTYPE_SLOTS) | JSCLASS_MARK_IS_TRACE,
265
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
265
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
266
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::Finalize,
266
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::Finalize,
267
  NULL, NULL, CType::ConstructData, CType::ConstructData, NULL,
267
  NULL, NULL, CType::ConstructData, CType::ConstructData, NULL,
268
  CType::HasInstance, JS_CLASS_TRACE(CType::Trace), NULL
268
  CType::HasInstance, JS_CLASS_TRACE(CType::Trace), NULL
 Lines 279-285   static JSClass sCDataClass = { Link Here 
279
static JSClass sCClosureClass = {
279
static JSClass sCClosureClass = {
280
  "CClosure",
280
  "CClosure",
281
  JSCLASS_HAS_RESERVED_SLOTS(CCLOSURE_SLOTS) | JSCLASS_MARK_IS_TRACE,
281
  JSCLASS_HAS_RESERVED_SLOTS(CCLOSURE_SLOTS) | JSCLASS_MARK_IS_TRACE,
282
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
282
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
283
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CClosure::Finalize,
283
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CClosure::Finalize,
284
  NULL, NULL, NULL, NULL, NULL, NULL, JS_CLASS_TRACE(CClosure::Trace), NULL
284
  NULL, NULL, NULL, NULL, NULL, NULL, JS_CLASS_TRACE(CClosure::Trace), NULL
285
};
285
};
 Lines 396-402   static JSPropertySpec sFunctionProps[] = Link Here 
396
static JSClass sInt64ProtoClass = {
396
static JSClass sInt64ProtoClass = {
397
  "Int64",
397
  "Int64",
398
  0,
398
  0,
399
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
399
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
400
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
400
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
401
  JSCLASS_NO_OPTIONAL_MEMBERS
401
  JSCLASS_NO_OPTIONAL_MEMBERS
402
};
402
};
 Lines 404-410   static JSClass sInt64ProtoClass = { Link Here 
404
static JSClass sUInt64ProtoClass = {
404
static JSClass sUInt64ProtoClass = {
405
  "UInt64",
405
  "UInt64",
406
  0,
406
  0,
407
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
407
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
408
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
408
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
409
  JSCLASS_NO_OPTIONAL_MEMBERS
409
  JSCLASS_NO_OPTIONAL_MEMBERS
410
};
410
};
 Lines 412-418   static JSClass sUInt64ProtoClass = { Link Here 
412
static JSClass sInt64Class = {
412
static JSClass sInt64Class = {
413
  "Int64",
413
  "Int64",
414
  JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
414
  JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
415
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
415
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
416
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
416
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
417
  JSCLASS_NO_OPTIONAL_MEMBERS
417
  JSCLASS_NO_OPTIONAL_MEMBERS
418
};
418
};
 Lines 420-426   static JSClass sInt64Class = { Link Here 
420
static JSClass sUInt64Class = {
420
static JSClass sUInt64Class = {
421
  "UInt64",
421
  "UInt64",
422
  JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
422
  JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
423
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
423
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
424
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
424
  JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
425
  JSCLASS_NO_OPTIONAL_MEMBERS
425
  JSCLASS_NO_OPTIONAL_MEMBERS
426
};
426
};
 Lines 944-950   JS_InitCTypesClass(JSContext* cx, JSObje Link Here 
944
    return false;
944
    return false;
945
945
946
  if (!JS_DefineProperty(cx, global, "ctypes", OBJECT_TO_JSVAL(ctypes),
946
  if (!JS_DefineProperty(cx, global, "ctypes", OBJECT_TO_JSVAL(ctypes),
947
         JS_PropertyStub, JS_PropertyStub, JSPROP_READONLY | JSPROP_PERMANENT)) {
947
         JS_PropertyStub, JS_StrictPropertyStub, JSPROP_READONLY | JSPROP_PERMANENT)) {
948
    return false;
948
    return false;
949
  }
949
  }
950
950
 Lines 3401-3406   JSBool Link Here 
3401
PointerType::ContentsSetter(JSContext* cx,
3401
PointerType::ContentsSetter(JSContext* cx,
3402
                            JSObject* obj,
3402
                            JSObject* obj,
3403
                            jsid idval,
3403
                            jsid idval,
3404
                            JSBool strict,
3404
                            jsval* vp)
3405
                            jsval* vp)
3405
{
3406
{
3406
  if (!CData::IsCData(cx, obj)) {
3407
  if (!CData::IsCData(cx, obj)) {
 Lines 3789-3795   ArrayType::Getter(JSContext* cx, JSObjec Link Here 
3789
}
3790
}
3790
3791
3791
JSBool
3792
JSBool
3792
ArrayType::Setter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp)
3793
ArrayType::Setter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict, jsval* vp)
3793
{
3794
{
3794
  // This should never happen, but we'll check to be safe.
3795
  // This should never happen, but we'll check to be safe.
3795
  if (!CData::IsCData(cx, obj)) {
3796
  if (!CData::IsCData(cx, obj)) {
 Lines 4431-4437   StructType::FieldGetter(JSContext* cx, J Link Here 
4431
}
4432
}
4432
4433
4433
JSBool
4434
JSBool
4434
StructType::FieldSetter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp)
4435
StructType::FieldSetter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict, jsval* vp)
4435
{
4436
{
4436
  if (!CData::IsCData(cx, obj)) {
4437
  if (!CData::IsCData(cx, obj)) {
4437
    JS_ReportError(cx, "not a CData");
4438
    JS_ReportError(cx, "not a CData");
 Lines 5592-5598   CData::ValueGetter(JSContext* cx, JSObje Link Here 
5592
}
5593
}
5593
5594
5594
JSBool
5595
JSBool
5595
CData::ValueSetter(JSContext* cx, JSObject* obj, jsid idval, jsval* vp)
5596
CData::ValueSetter(JSContext* cx, JSObject* obj, jsid idval, JSBool strict, jsval* vp)
5596
{
5597
{
5597
  if (!IsCData(cx, obj)) {
5598
  if (!IsCData(cx, obj)) {
5598
    JS_ReportError(cx, "not a CData");
5599
    JS_ReportError(cx, "not a CData");
(-)a/js/src/ctypes/Library.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 65-71   namespace Library Link Here 
65
static JSClass sLibraryClass = {
65
static JSClass sLibraryClass = {
66
  "Library",
66
  "Library",
67
  JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS) | JSCLASS_MARK_IS_TRACE,
67
  JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS) | JSCLASS_MARK_IS_TRACE,
68
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
68
  JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
69
  JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize,
69
  JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize,
70
  JSCLASS_NO_OPTIONAL_MEMBERS
70
  JSCLASS_NO_OPTIONAL_MEMBERS
71
};
71
};
(-)a/js/src/jsdbgapi.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 2170-2176   ethogram_finalize(JSContext *cx, JSObjec Link Here 
2170
static JSClass ethogram_class = {
2170
static JSClass ethogram_class = {
2171
    "Ethogram",
2171
    "Ethogram",
2172
    JSCLASS_HAS_PRIVATE,
2172
    JSCLASS_HAS_PRIVATE,
2173
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
2173
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
2174
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ethogram_finalize,
2174
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ethogram_finalize,
2175
    JSCLASS_NO_OPTIONAL_MEMBERS
2175
    JSCLASS_NO_OPTIONAL_MEMBERS
2176
};
2176
};
(-)a/js/src/xpconnect/shell/xpcshell.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 884-895   static JSFunctionSpec glob_functions[] = Link Here 
884
884
885
JSClass global_class = {
885
JSClass global_class = {
886
    "global", 0,
886
    "global", 0,
887
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,
887
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_StrictPropertyStub,
888
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
888
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
889
};
889
};
890
890
891
static JSBool
891
static JSBool
892
env_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
892
env_setProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
893
{
893
{
894
/* XXX porting may be easy, but these don't seem to supply setenv by default */
894
/* XXX porting may be easy, but these don't seem to supply setenv by default */
895
#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS
895
#if !defined XP_BEOS && !defined XP_OS2 && !defined SOLARIS
(-)a/js/src/xpconnect/src/nsXPConnect.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 945-951   TempGlobalResolve(JSContext *aJSContext, Link Here 
945
945
946
static JSClass xpcTempGlobalClass = {
946
static JSClass xpcTempGlobalClass = {
947
    "xpcTempGlobalClass", JSCLASS_GLOBAL_FLAGS,
947
    "xpcTempGlobalClass", JSCLASS_GLOBAL_FLAGS,
948
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,
948
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_StrictPropertyStub,
949
    JS_EnumerateStub, TempGlobalResolve, JS_ConvertStub,   nsnull,
949
    JS_EnumerateStub, TempGlobalResolve, JS_ConvertStub,   nsnull,
950
    JSCLASS_NO_OPTIONAL_MEMBERS
950
    JSCLASS_NO_OPTIONAL_MEMBERS
951
};
951
};
(-)a/js/src/xpconnect/src/qsgen.py (-3 / +6 lines)
Line     Link Here 
 Lines 778-784   def writeQuickStub(f, customMethodCalls, Link Here 
778
    signature = "static JSBool\n"
778
    signature = "static JSBool\n"
779
    if isAttr:
779
    if isAttr:
780
        # JSPropertyOp signature.
780
        # JSPropertyOp signature.
781
        signature += "%s(JSContext *cx, JSObject *obj, jsid id,%s jsval *vp)\n"
781
        if isSetter:
782
            signature += "%s(JSContext *cx, JSObject *obj, jsid id, JSBool strict,%s jsval *vp)\n"
783
        else:
784
            signature += "%s(JSContext *cx, JSObject *obj, jsid id,%s jsval *vp)\n"
782
    else:
785
    else:
783
        # JSFastNative.
786
        # JSFastNative.
784
        signature += "%s(JSContext *cx, uintN argc,%s jsval *vp)\n"
787
        signature += "%s(JSContext *cx, uintN argc,%s jsval *vp)\n"
 Lines 815-822   def writeQuickStub(f, customMethodCalls, Link Here 
815
            argumentValues = (customMethodCall['additionalArgumentValues']
818
            argumentValues = (customMethodCall['additionalArgumentValues']
816
                              % nativeName)
819
                              % nativeName)
817
            if isAttr:
820
            if isAttr:
818
                callTemplate += ("    return %s(cx, obj, id, %s, vp);\n"
821
                callTemplate += ("    return %s(cx, obj, id%s, %s, vp);\n"
819
                                 % (templateName, argumentValues))
822
                                 % (templateName, ", strict" if isSetter else "", argumentValues))
820
            else:
823
            else:
821
                callTemplate += ("    return %s(cx, argc, %s, vp);\n"
824
                callTemplate += ("    return %s(cx, argc, %s, vp);\n"
822
                                 % (templateName, argumentValues))
825
                                 % (templateName, argumentValues))
(-)a/js/src/xpconnect/src/xpccomponents.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 3116-3122   sandbox_convert(JSContext *cx, JSObject Link Here 
3116
static JSClass SandboxClass = {
3116
static JSClass SandboxClass = {
3117
    "Sandbox",
3117
    "Sandbox",
3118
    JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_GLOBAL_FLAGS,
3118
    JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_GLOBAL_FLAGS,
3119
    JS_PropertyStub,   JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
3119
    JS_PropertyStub,   JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
3120
    sandbox_enumerate, sandbox_resolve, sandbox_convert,  sandbox_finalize,
3120
    sandbox_enumerate, sandbox_resolve, sandbox_convert,  sandbox_finalize,
3121
    JSCLASS_NO_OPTIONAL_MEMBERS
3121
    JSCLASS_NO_OPTIONAL_MEMBERS
3122
};
3122
};
(-)a/js/src/xpconnect/src/xpcquickstubs.cpp (-13 / +33 lines)
Line     Link Here 
 Lines 118-123   LookupInterfaceOrAncestor(PRUint32 table Link Here 
118
    return entry;
118
    return entry;
119
}
119
}
120
120
121
// Apply |op| to |obj|, |id|, and |vp|. If |op| is a setter, treat the assignment as lenient.
122
template<typename Op>
123
static inline JSBool ApplyPropertyOp(JSContext *cx, Op op, JSObject *obj, jsid id, jsval *vp);
124
125
template<>
126
inline JSBool
127
ApplyPropertyOp<JSPropertyOp>(JSContext *cx, JSPropertyOp op, JSObject *obj, jsid id, jsval *vp)
128
{
129
    return op(cx, obj, id, vp);
130
}
131
132
template<>
133
inline JSBool
134
ApplyPropertyOp<JSStrictPropertyOp>(JSContext *cx, JSStrictPropertyOp op, JSObject *obj,
135
                                    jsid id, jsval *vp)
136
{
137
    return op(cx, obj, id, false, vp);
138
}
139
140
template<typename Op>
121
static JSBool
141
static JSBool
122
PropertyOpForwarder(JSContext *cx, uintN argc, jsval *vp)
142
PropertyOpForwarder(JSContext *cx, uintN argc, jsval *vp)
123
{
143
{
 Lines 133-139   PropertyOpForwarder(JSContext *cx, uintN Link Here 
133
    if(!JS_GetReservedSlot(cx, callee, 0, &v))
153
    if(!JS_GetReservedSlot(cx, callee, 0, &v))
134
        return JS_FALSE;
154
        return JS_FALSE;
135
    JSObject *ptrobj = JSVAL_TO_OBJECT(v);
155
    JSObject *ptrobj = JSVAL_TO_OBJECT(v);
136
    JSPropertyOp *popp = static_cast<JSPropertyOp *>(JS_GetPrivate(cx, ptrobj));
156
    Op *popp = static_cast<Op *>(JS_GetPrivate(cx, ptrobj));
137
157
138
    if(!JS_GetReservedSlot(cx, callee, 1, &v))
158
    if(!JS_GetReservedSlot(cx, callee, 1, &v))
139
        return JS_FALSE;
159
        return JS_FALSE;
 Lines 143-149   PropertyOpForwarder(JSContext *cx, uintN Link Here 
143
    if (!JS_ValueToId(cx, argval, &id))
163
    if (!JS_ValueToId(cx, argval, &id))
144
        return JS_FALSE;
164
        return JS_FALSE;
145
    JS_SET_RVAL(cx, vp, argval);
165
    JS_SET_RVAL(cx, vp, argval);
146
    return (*popp)(cx, obj, id, vp);
166
    return ApplyPropertyOp<Op>(cx, *popp, obj, id, vp);
147
}
167
}
148
168
149
static void
169
static void
 Lines 156-175   PointerFinalize(JSContext *cx, JSObject Link Here 
156
static JSClass
176
static JSClass
157
PointerHolderClass = {
177
PointerHolderClass = {
158
    "Pointer", JSCLASS_HAS_PRIVATE,
178
    "Pointer", JSCLASS_HAS_PRIVATE,
159
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
179
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
160
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize,
180
    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize,
161
    JSCLASS_NO_OPTIONAL_MEMBERS
181
    JSCLASS_NO_OPTIONAL_MEMBERS
162
};
182
};
163
183
184
template<typename Op>
164
static JSObject *
185
static JSObject *
165
GeneratePropertyOp(JSContext *cx, JSObject *obj, jsid id, uintN argc,
186
GeneratePropertyOp(JSContext *cx, JSObject *obj, jsid id, uintN argc, Op pop)
166
                   JSPropertyOp pop)
167
{
187
{
168
    // The JS engine provides two reserved slots on function objects for
188
    // The JS engine provides two reserved slots on function objects for
169
    // XPConnect to use. Use them to stick the necessary info here.
189
    // XPConnect to use. Use them to stick the necessary info here.
170
    JSFunction *fun =
190
    JSFunction *fun =
171
        JS_NewFunctionById(cx, reinterpret_cast<JSNative>(PropertyOpForwarder),
191
        JS_NewFunctionById(cx, PropertyOpForwarder<Op>, argc, 0, obj, id);
172
                           argc, 0, obj, id);
173
    if(!fun)
192
    if(!fun)
174
        return JS_FALSE;
193
        return JS_FALSE;
175
194
 Lines 177-188   GeneratePropertyOp(JSContext *cx, JSObje Link Here 
177
196
178
    js::AutoObjectRooter tvr(cx, funobj);
197
    js::AutoObjectRooter tvr(cx, funobj);
179
198
180
    // Unfortunately, we cannot guarantee that JSPropertyOp is aligned. Use a
199
    // Unfortunately, we cannot guarantee that Op is aligned. Use a
181
    // second object to work around this.
200
    // second object to work around this.
182
    JSObject *ptrobj = JS_NewObject(cx, &PointerHolderClass, nsnull, funobj);
201
    JSObject *ptrobj = JS_NewObject(cx, &PointerHolderClass, nsnull, funobj);
183
    if(!ptrobj)
202
    if(!ptrobj)
184
        return JS_FALSE;
203
        return JS_FALSE;
185
    JSPropertyOp *popp = new JSPropertyOp;
204
    Op *popp = new Op;
186
    if(!popp)
205
    if(!popp)
187
        return JS_FALSE;
206
        return JS_FALSE;
188
    *popp = pop;
207
    *popp = pop;
 Lines 195-201   GeneratePropertyOp(JSContext *cx, JSObje Link Here 
195
214
196
static JSBool
215
static JSBool
197
ReifyPropertyOps(JSContext *cx, JSObject *obj, jsid id,
216
ReifyPropertyOps(JSContext *cx, JSObject *obj, jsid id,
198
                 JSPropertyOp getter, JSPropertyOp setter,
217
                 JSPropertyOp getter, JSStrictPropertyOp setter,
199
                 JSObject **getterobjp, JSObject **setterobjp)
218
                 JSObject **getterobjp, JSObject **setterobjp)
200
{
219
{
201
    // Generate both getter and setter and stash them in the prototype.
220
    // Generate both getter and setter and stash them in the prototype.
 Lines 233-239   ReifyPropertyOps(JSContext *cx, JSObject Link Here 
233
        *setterobjp = setterobj;
252
        *setterobjp = setterobj;
234
    return JS_DefinePropertyById(cx, obj, id, JSVAL_VOID,
253
    return JS_DefinePropertyById(cx, obj, id, JSVAL_VOID,
235
                                 JS_DATA_TO_FUNC_PTR(JSPropertyOp, getterobj),
254
                                 JS_DATA_TO_FUNC_PTR(JSPropertyOp, getterobj),
236
                                 JS_DATA_TO_FUNC_PTR(JSPropertyOp, setterobj),
255
                                 JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, setterobj),
237
                                 attrs);
256
                                 attrs);
238
}
257
}
239
258
 Lines 328-334   DefineGetterOrSetter(JSContext *cx, uint Link Here 
328
{
347
{
329
    uintN attrs;
348
    uintN attrs;
330
    JSBool found;
349
    JSBool found;
331
    JSPropertyOp getter, setter;
350
    JSPropertyOp getter;
351
    JSStrictPropertyOp setter;
332
    JSObject *obj2;
352
    JSObject *obj2;
333
    jsval v;
353
    jsval v;
334
    jsid id;
354
    jsid id;
 Lines 681-687   xpc_qsThrowBadSetterValue(JSContext *cx, Link Here 
681
}
701
}
682
702
683
JSBool
703
JSBool
684
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
704
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
685
{
705
{
686
    return JS_ReportErrorFlagsAndNumber(cx,
706
    return JS_ReportErrorFlagsAndNumber(cx,
687
                                        JSREPORT_WARNING | JSREPORT_STRICT |
707
                                        JSREPORT_WARNING | JSREPORT_STRICT |
(-)a/js/src/xpconnect/src/xpcquickstubs.h (-2 / +2 lines)
Line     Link Here 
 Lines 51-57   class XPCCallContext; Link Here 
51
struct xpc_qsPropertySpec {
51
struct xpc_qsPropertySpec {
52
    const char *name;
52
    const char *name;
53
    JSPropertyOp getter;
53
    JSPropertyOp getter;
54
    JSPropertyOp setter;
54
    JSStrictPropertyOp setter;
55
};
55
};
56
56
57
struct xpc_qsFunctionSpec {
57
struct xpc_qsFunctionSpec {
 Lines 229-235   xpc_qsThrowBadSetterValue(JSContext *cx, Link Here 
229
229
230
230
231
JSBool
231
JSBool
232
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
232
xpc_qsGetterOnlyPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
233
233
234
/* Functions for converting values between COM and JS. */
234
/* Functions for converting values between COM and JS. */
235
235
(-)a/js/src/xpconnect/src/xpcthreadcontext.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 218-224   static JSClass global_class = { Link Here 
218
#else
218
#else
219
    0,
219
    0,
220
#endif
220
#endif
221
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
221
    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
222
    JS_EnumerateStub, SafeGlobalResolve, JS_ConvertStub, SafeFinalize,
222
    JS_EnumerateStub, SafeGlobalResolve, JS_ConvertStub, SafeFinalize,
223
    JSCLASS_NO_OPTIONAL_MEMBERS
223
    JSCLASS_NO_OPTIONAL_MEMBERS
224
};
224
};
(-)a/js/src/xpconnect/src/xpcwrappedjsclass.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 1484-1490   nsXPCWrappedJSClass::CallMethod(nsXPCWra Link Here 
1484
        uintN attrs;
1484
        uintN attrs;
1485
        JSBool found;
1485
        JSBool found;
1486
        JSPropertyOp getter;
1486
        JSPropertyOp getter;
1487
        JSPropertyOp setter;
1487
        JSStrictPropertyOp setter;
1488
        if(!JS_GetPropertyAttrsGetterAndSetter(cx, obj, name,
1488
        if(!JS_GetPropertyAttrsGetterAndSetter(cx, obj, name,
1489
                                               &attrs, &found,
1489
                                               &attrs, &found,
1490
                                               &getter, &setter))
1490
                                               &getter, &setter))
(-)a/js/src/xpconnect/src/xpcwrappednativejsops.cpp (-40 / +67 lines)
Line     Link Here 
 Lines 493-504   DefinePropertyIfFound(XPCCallContext& cc Link Here 
493
    propFlags |= JSPROP_GETTER | JSPROP_SHARED;
493
    propFlags |= JSPROP_GETTER | JSPROP_SHARED;
494
    JSObject* funobj = JSVAL_TO_OBJECT(funval);
494
    JSObject* funobj = JSVAL_TO_OBJECT(funval);
495
    JSPropertyOp getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, funobj);
495
    JSPropertyOp getter = JS_DATA_TO_FUNC_PTR(JSPropertyOp, funobj);
496
    JSPropertyOp setter;
496
    JSStrictPropertyOp setter;
497
    if(member->IsWritableAttribute())
497
    if(member->IsWritableAttribute())
498
    {
498
    {
499
        propFlags |= JSPROP_SETTER;
499
        propFlags |= JSPROP_SETTER;
500
        propFlags &= ~JSPROP_READONLY;
500
        propFlags &= ~JSPROP_READONLY;
501
        setter = getter;
501
        setter = JS_DATA_TO_FUNC_PTR(JSStrictPropertyOp, funobj);
502
    }
502
    }
503
    else
503
    else
504
    {
504
    {
 Lines 517-529   DefinePropertyIfFound(XPCCallContext& cc Link Here 
517
/***************************************************************************/
517
/***************************************************************************/
518
518
519
static JSBool
519
static JSBool
520
XPC_WN_OnlyIWrite_PropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
520
XPC_WN_OnlyIWrite_AddPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
521
{
521
{
522
    XPCCallContext ccx(JS_CALLER, cx, obj, nsnull, id);
522
    XPCCallContext ccx(JS_CALLER, cx, obj, nsnull, id);
523
    XPCWrappedNative* wrapper = ccx.GetWrapper();
523
    XPCWrappedNative* wrapper = ccx.GetWrapper();
524
    THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
524
    THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
525
525
526
    // Allow only XPConnect to add the property
526
    // Allow only XPConnect to add/set the property
527
    if(ccx.GetResolveName() == id)
527
    if(ccx.GetResolveName() == id)
528
        return JS_TRUE;
528
        return JS_TRUE;
529
529
 Lines 531-542   XPC_WN_OnlyIWrite_PropertyStub(JSContext Link Here 
531
}
531
}
532
532
533
static JSBool
533
static JSBool
534
XPC_WN_OnlyIWrite_SetPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
535
{
536
    return XPC_WN_OnlyIWrite_AddPropertyStub(cx, obj, id, vp);
537
}
538
539
static JSBool
534
XPC_WN_CannotModifyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
540
XPC_WN_CannotModifyPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
535
{
541
{
536
    return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx);
542
    return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx);
537
}
543
}
538
544
539
static JSBool
545
static JSBool
546
XPC_WN_CannotModifyStrictPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
547
                                      jsval *vp)
548
{
549
    return XPC_WN_CannotModifyPropertyStub(cx, obj, id, vp);
550
}
551
552
static JSBool
540
XPC_WN_Shared_Convert(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
553
XPC_WN_Shared_Convert(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
541
{
554
{
542
    if(type == JSTYPE_OBJECT)
555
    if(type == JSTYPE_OBJECT)
 Lines 864-873   js::Class XPC_WN_NoHelper_JSClass = { Link Here 
864
    JSCLASS_MARK_IS_TRACE, // flags;
877
    JSCLASS_MARK_IS_TRACE, // flags;
865
878
866
    /* Mandatory non-null function pointer members. */
879
    /* Mandatory non-null function pointer members. */
867
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_PropertyStub), // addProperty
880
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_AddPropertyStub),       // addProperty
868
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),// delProperty
881
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),         // delProperty
869
    js::PropertyStub,                                            // getProperty
882
    js::PropertyStub,                                                     // getProperty
870
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_PropertyStub), // setProperty
883
    JS_VALUEIFY(js::StrictPropertyOp, XPC_WN_OnlyIWrite_SetPropertyStub), // setProperty
871
   
884
   
872
    XPC_WN_Shared_Enumerate,                                     // enumerate
885
    XPC_WN_Shared_Enumerate,                                     // enumerate
873
    XPC_WN_NoHelper_Resolve,                                     // resolve
886
    XPC_WN_NoHelper_Resolve,                                     // resolve
 Lines 926-931   XPC_WN_MaybeResolvingPropertyStub(JSCont Link Here 
926
    return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx);
939
    return Throw(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN, cx);
927
}
940
}
928
941
942
static JSBool
943
XPC_WN_MaybeResolvingStrictPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
944
                                        jsval *vp)
945
{
946
    return XPC_WN_MaybeResolvingPropertyStub(cx, obj, id, vp);
947
}
948
929
// macro fun!
949
// macro fun!
930
#define PRE_HELPER_STUB_NO_SLIM                                              \
950
#define PRE_HELPER_STUB_NO_SLIM                                              \
931
    XPCWrappedNative* wrapper =                                              \
951
    XPCWrappedNative* wrapper =                                              \
 Lines 981-987   XPC_WN_Helper_GetProperty(JSContext *cx, Link Here 
981
}
1001
}
982
1002
983
static JSBool
1003
static JSBool
984
XPC_WN_Helper_SetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1004
XPC_WN_Helper_SetProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
985
{
1005
{
986
    PRE_HELPER_STUB
1006
    PRE_HELPER_STUB
987
    SetProperty(wrapper, cx, obj, id, vp, &retval);
1007
    SetProperty(wrapper, cx, obj, id, vp, &retval);
 Lines 1478-1492   XPCNativeScriptableShared::PopulateJSCla Link Here 
1478
    else
1498
    else
1479
        mJSClass.base.getProperty = js::PropertyStub;
1499
        mJSClass.base.getProperty = js::PropertyStub;
1480
1500
1481
    JSPropertyOp setProperty;
1501
    JSStrictPropertyOp setProperty;
1482
    if(mFlags.WantSetProperty())
1502
    if(mFlags.WantSetProperty())
1483
        setProperty = XPC_WN_Helper_SetProperty;
1503
        setProperty = XPC_WN_Helper_SetProperty;
1484
    else if(mFlags.UseJSStubForSetProperty())
1504
    else if(mFlags.UseJSStubForSetProperty())
1485
        setProperty = JS_PropertyStub;
1505
        setProperty = JS_StrictPropertyStub;
1486
    else if(mFlags.AllowPropModsDuringResolve())
1506
    else if(mFlags.AllowPropModsDuringResolve())
1487
        setProperty = XPC_WN_MaybeResolvingPropertyStub;
1507
        setProperty = XPC_WN_MaybeResolvingStrictPropertyStub;
1488
    else
1508
    else
1489
        setProperty = XPC_WN_CannotModifyPropertyStub;
1509
        setProperty = XPC_WN_CannotModifyStrictPropertyStub;
1490
    mJSClass.base.setProperty = js::Valueify(setProperty);
1510
    mJSClass.base.setProperty = js::Valueify(setProperty);
1491
1511
1492
    // We figure out most of the enumerate strategy at call time.
1512
    // We figure out most of the enumerate strategy at call time.
 Lines 1752-1758   js::Class XPC_WN_ModsAllowed_WithCall_Pr Link Here 
1752
    js::PropertyStub,               // addProperty;
1772
    js::PropertyStub,               // addProperty;
1753
    js::PropertyStub,               // delProperty;
1773
    js::PropertyStub,               // delProperty;
1754
    js::PropertyStub,               // getProperty;
1774
    js::PropertyStub,               // getProperty;
1755
    js::PropertyStub,               // setProperty;
1775
    js::StrictPropertyStub,         // setProperty;
1756
    XPC_WN_Shared_Proto_Enumerate,  // enumerate;
1776
    XPC_WN_Shared_Proto_Enumerate,  // enumerate;
1757
    XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
1777
    XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
1758
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert), // convert;
1778
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert), // convert;
 Lines 1779-1785   js::Class XPC_WN_ModsAllowed_NoCall_Prot Link Here 
1779
    js::PropertyStub,               // addProperty;
1799
    js::PropertyStub,               // addProperty;
1780
    js::PropertyStub,               // delProperty;
1800
    js::PropertyStub,               // delProperty;
1781
    js::PropertyStub,               // getProperty;
1801
    js::PropertyStub,               // getProperty;
1782
    js::PropertyStub,               // setProperty;
1802
    js::StrictPropertyStub,         // setProperty;
1783
    XPC_WN_Shared_Proto_Enumerate,  // enumerate;
1803
    XPC_WN_Shared_Proto_Enumerate,  // enumerate;
1784
    XPC_WN_ModsAllowed_Proto_Resolve,// resolve;
1804
    XPC_WN_ModsAllowed_Proto_Resolve,// resolve;
1785
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert), // convert;
1805
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert), // convert;
 Lines 1801-1807   js::Class XPC_WN_ModsAllowed_NoCall_Prot Link Here 
1801
/***************************************************************************/
1821
/***************************************************************************/
1802
1822
1803
static JSBool
1823
static JSBool
1804
XPC_WN_OnlyIWrite_Proto_PropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1824
XPC_WN_OnlyIWrite_Proto_AddPropertyStub(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1805
{
1825
{
1806
    NS_ASSERTION(obj->getClass() == &XPC_WN_NoMods_WithCall_Proto_JSClass ||
1826
    NS_ASSERTION(obj->getClass() == &XPC_WN_NoMods_WithCall_Proto_JSClass ||
1807
                 obj->getClass() == &XPC_WN_NoMods_NoCall_Proto_JSClass,
1827
                 obj->getClass() == &XPC_WN_NoMods_NoCall_Proto_JSClass,
 Lines 1824-1829   XPC_WN_OnlyIWrite_Proto_PropertyStub(JSC Link Here 
1824
}
1844
}
1825
1845
1826
static JSBool
1846
static JSBool
1847
XPC_WN_OnlyIWrite_Proto_SetPropertyStub(JSContext *cx, JSObject *obj, jsid id, JSBool strict,
1848
                                        jsval *vp)
1849
{
1850
    return XPC_WN_OnlyIWrite_Proto_AddPropertyStub(cx, obj, id, vp);
1851
}
1852
1853
static JSBool
1827
XPC_WN_NoMods_Proto_Resolve(JSContext *cx, JSObject *obj, jsid id)
1854
XPC_WN_NoMods_Proto_Resolve(JSContext *cx, JSObject *obj, jsid id)
1828
{
1855
{
1829
    NS_ASSERTION(obj->getClass() == &XPC_WN_NoMods_WithCall_Proto_JSClass ||
1856
    NS_ASSERTION(obj->getClass() == &XPC_WN_NoMods_WithCall_Proto_JSClass ||
 Lines 1857-1870   js::Class XPC_WN_NoMods_WithCall_Proto_J Link Here 
1857
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE, // flags;
1884
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE, // flags;
1858
1885
1859
    /* Mandatory non-null function pointer members. */
1886
    /* Mandatory non-null function pointer members. */
1860
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_PropertyStub), // addProperty;
1887
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_AddPropertyStub),       // addProperty;
1861
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),      // delProperty;
1888
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),               // delProperty;
1862
    js::PropertyStub,                                                  // getProperty;
1889
    js::PropertyStub,                                                           // getProperty;
1863
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_PropertyStub), // setProperty;
1890
    JS_VALUEIFY(js::StrictPropertyOp, XPC_WN_OnlyIWrite_Proto_SetPropertyStub), // setProperty;
1864
    XPC_WN_Shared_Proto_Enumerate,                                     // enumerate;
1891
    XPC_WN_Shared_Proto_Enumerate,                                              // enumerate;
1865
    XPC_WN_NoMods_Proto_Resolve,                                       // resolve;
1892
    XPC_WN_NoMods_Proto_Resolve,                                                // resolve;
1866
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert),           // convert;
1893
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert),                    // convert;
1867
    XPC_WN_Shared_Proto_Finalize,                                      // finalize;
1894
    XPC_WN_Shared_Proto_Finalize,                                               // finalize;
1868
1895
1869
    /* Optionally non-null members start here. */
1896
    /* Optionally non-null members start here. */
1870
    nsnull,                         // reserved0;
1897
    nsnull,                         // reserved0;
 Lines 1884-1897   js::Class XPC_WN_NoMods_NoCall_Proto_JSC Link Here 
1884
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE,              // flags;
1911
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE,              // flags;
1885
1912
1886
    /* Mandatory non-null function pointer members. */
1913
    /* Mandatory non-null function pointer members. */
1887
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_PropertyStub), // addProperty;
1914
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_AddPropertyStub),       // addProperty;
1888
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),      // delProperty;
1915
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),               // delProperty;
1889
    js::PropertyStub,                                                  // getProperty;
1916
    js::PropertyStub,                                                           // getProperty;
1890
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_Proto_PropertyStub), // setProperty;
1917
    JS_VALUEIFY(js::StrictPropertyOp, XPC_WN_OnlyIWrite_Proto_SetPropertyStub), // setProperty;
1891
    XPC_WN_Shared_Proto_Enumerate,                                     // enumerate;
1918
    XPC_WN_Shared_Proto_Enumerate,                                              // enumerate;
1892
    XPC_WN_NoMods_Proto_Resolve,                                       // resolve;
1919
    XPC_WN_NoMods_Proto_Resolve,                                                // resolve;
1893
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert),           // convert;
1920
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Proto_Convert),                    // convert;
1894
    XPC_WN_Shared_Proto_Finalize,                                      // finalize;
1921
    XPC_WN_Shared_Proto_Finalize,                                               // finalize;
1895
1922
1896
    /* Optionally non-null members start here. */
1923
    /* Optionally non-null members start here. */
1897
    nsnull,                         // reserved0;
1924
    nsnull,                         // reserved0;
 Lines 1968-1979   js::Class XPC_WN_Tearoff_JSClass = { Link Here 
1968
    "WrappedNative_TearOff",                        // name;
1995
    "WrappedNative_TearOff",                        // name;
1969
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE,          // flags;
1996
    WRAPPER_SLOTS | JSCLASS_MARK_IS_TRACE,          // flags;
1970
1997
1971
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_PropertyStub),   // addProperty;
1998
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_AddPropertyStub),       // addProperty;
1972
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),  // delProperty;
1999
    JS_VALUEIFY(js::PropertyOp, XPC_WN_CannotModifyPropertyStub),         // delProperty;
1973
    js::PropertyStub,                                              // getProperty;
2000
    js::PropertyStub,                                                     // getProperty;
1974
    JS_VALUEIFY(js::PropertyOp, XPC_WN_OnlyIWrite_PropertyStub),   // setProperty;
2001
    JS_VALUEIFY(js::StrictPropertyOp, XPC_WN_OnlyIWrite_SetPropertyStub), // setProperty;
1975
    XPC_WN_TearOff_Enumerate,                                      // enumerate;
2002
    XPC_WN_TearOff_Enumerate,                                             // enumerate;
1976
    XPC_WN_TearOff_Resolve,                                        // resolve;
2003
    XPC_WN_TearOff_Resolve,                                               // resolve;
1977
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Convert),             // convert;
2004
    JS_VALUEIFY(js::ConvertOp, XPC_WN_Shared_Convert),                    // convert;
1978
    XPC_WN_TearOff_Finalize                                        // finalize;
2005
    XPC_WN_TearOff_Finalize                                               // finalize;
1979
};
2006
};
(-)a/js/src/xpconnect/src/xpcwrappednativescope.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 209-215   js::Class XPC_WN_NoHelper_Proto_JSClass Link Here 
209
    js::PropertyStub,               // addProperty;
209
    js::PropertyStub,               // addProperty;
210
    js::PropertyStub,               // delProperty;
210
    js::PropertyStub,               // delProperty;
211
    js::PropertyStub,               // getProperty;
211
    js::PropertyStub,               // getProperty;
212
    js::PropertyStub,               // setProperty;
212
    js::StrictPropertyStub,         // setProperty;
213
    js::EnumerateStub,              // enumerate;
213
    js::EnumerateStub,              // enumerate;
214
    JS_ResolveStub,                 // resolve;
214
    JS_ResolveStub,                 // resolve;
215
    js::ConvertStub,                // convert;
215
    js::ConvertStub,                // convert;
(-)a/js/src/xpconnect/tests/TestXPC.cpp (-1 / +1 lines)
Line     Link Here 
 Lines 138-144   static JSFunctionSpec glob_functions[] = Link Here 
138
138
139
static JSClass global_class = {
139
static JSClass global_class = {
140
    "global", 0,
140
    "global", 0,
141
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,
141
    JS_PropertyStub,  JS_PropertyStub,  JS_PropertyStub,  JS_StrictPropertyStub,
142
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
142
    JS_EnumerateStub, JS_ResolveStub,   JS_ConvertStub,   nsnull
143
};
143
};
144
144
(-)a/js/src/xpconnect/wrappers/XrayWrapper.cpp (-6 / +7 lines)
Line     Link Here 
 Lines 99-105   static JSBool Link Here 
99
holder_get(JSContext *cx, JSObject *holder, jsid id, jsval *vp);
99
holder_get(JSContext *cx, JSObject *holder, jsid id, jsval *vp);
100
100
101
static JSBool
101
static JSBool
102
holder_set(JSContext *cx, JSObject *holder, jsid id, jsval *vp);
102
holder_set(JSContext *cx, JSObject *holder, jsid id, JSBool strict, jsval *vp);
103
103
104
namespace XrayUtils {
104
namespace XrayUtils {
105
105
 Lines 202-208   holder_get(JSContext *cx, JSObject *wrap Link Here 
202
}
202
}
203
203
204
static JSBool
204
static JSBool
205
holder_set(JSContext *cx, JSObject *wrapper, jsid id, jsval *vp)
205
holder_set(JSContext *cx, JSObject *wrapper, jsid id, JSBool strict, jsval *vp)
206
{
206
{
207
    NS_ASSERTION(wrapper->isProxy(), "bad this object in set");
207
    NS_ASSERTION(wrapper->isProxy(), "bad this object in set");
208
    JSObject *holder = GetHolder(wrapper);
208
    JSObject *holder = GetHolder(wrapper);
 Lines 296-302   ResolveNativeProperty(JSContext *cx, JSO Link Here 
296
        // don't have one, we have to avoid calling the scriptable helper's
296
        // don't have one, we have to avoid calling the scriptable helper's
297
        // GetProperty method for this property, so stub out the getter and
297
        // GetProperty method for this property, so stub out the getter and
298
        // setter here explicitly.
298
        // setter here explicitly.
299
        desc->getter = desc->setter = JS_PropertyStub;
299
        desc->getter = JS_PropertyStub;
300
        desc->setter = JS_StrictPropertyStub;
300
    }
301
    }
301
302
302
    if (!JS_WrapValue(cx, &desc->value) || !JS_WrapValue(cx, &fval))
303
    if (!JS_WrapValue(cx, &desc->value) || !JS_WrapValue(cx, &fval))
 Lines 305-311   ResolveNativeProperty(JSContext *cx, JSO Link Here 
305
    if (desc->attrs & JSPROP_GETTER)
306
    if (desc->attrs & JSPROP_GETTER)
306
        desc->getter = CastAsJSPropertyOp(JSVAL_TO_OBJECT(fval));
307
        desc->getter = CastAsJSPropertyOp(JSVAL_TO_OBJECT(fval));
307
    if (desc->attrs & JSPROP_SETTER)
308
    if (desc->attrs & JSPROP_SETTER)
308
        desc->setter = desc->getter;
309
        desc->setter = CastAsJSStrictPropertyOp(JSVAL_TO_OBJECT(fval));
309
310
310
    // Define the property.
311
    // Define the property.
311
    return JS_DefinePropertyById(cx, holder, id, desc->value,
312
    return JS_DefinePropertyById(cx, holder, id, desc->value,
 Lines 768-779   XrayWrapper<Base>::get(JSContext *cx, JS Link Here 
768
template <typename Base>
769
template <typename Base>
769
bool
770
bool
770
XrayWrapper<Base>::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
771
XrayWrapper<Base>::set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
771
                       js::Value *vp)
772
                       bool strict, js::Value *vp)
772
{
773
{
773
    // Skip our Base if it isn't already JSProxyHandler.
774
    // Skip our Base if it isn't already JSProxyHandler.
774
    // NB: None of the functions we call are prepared for the receiver not
775
    // NB: None of the functions we call are prepared for the receiver not
775
    // being the wrapper, so ignore the receiver here.
776
    // being the wrapper, so ignore the receiver here.
776
    return JSProxyHandler::set(cx, wrapper, wrapper, id, vp);
777
    return JSProxyHandler::set(cx, wrapper, wrapper, id, strict, vp);
777
}
778
}
778
779
779
template <typename Base>
780
template <typename Base>
(-)a/js/src/xpconnect/wrappers/XrayWrapper.h (-1 / +1 lines)
Line     Link Here 
 Lines 84-90   class XrayWrapper : public Base { Link Here 
84
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
84
    virtual bool get(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
85
                     js::Value *vp);
85
                     js::Value *vp);
86
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
86
    virtual bool set(JSContext *cx, JSObject *wrapper, JSObject *receiver, jsid id,
87
                     js::Value *vp);
87
                     bool strict, js::Value *vp);
88
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
88
    virtual bool has(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
89
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
89
    virtual bool hasOwn(JSContext *cx, JSObject *wrapper, jsid id, bool *bp);
90
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
90
    virtual bool keys(JSContext *cx, JSObject *wrapper, js::AutoIdVector &props);
(-)a/modules/plugin/base/src/nsJSNPRuntime.cpp (-3 / +3 lines)
Line     Link Here 
 Lines 151-157   static JSBool Link Here 
151
NPObjWrapper_DelProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
151
NPObjWrapper_DelProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
152
152
153
static JSBool
153
static JSBool
154
NPObjWrapper_SetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
154
NPObjWrapper_SetProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp);
155
155
156
static JSBool
156
static JSBool
157
NPObjWrapper_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
157
NPObjWrapper_GetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
 Lines 215-221   static JSClass sNPObjectMemberClass = Link Here 
215
  {
215
  {
216
    "NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE,
216
    "NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE,
217
    JS_PropertyStub, JS_PropertyStub,
217
    JS_PropertyStub, JS_PropertyStub,
218
    JS_PropertyStub, JS_PropertyStub, JS_EnumerateStub,
218
    JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub,
219
    JS_ResolveStub, NPObjectMember_Convert,
219
    JS_ResolveStub, NPObjectMember_Convert,
220
    NPObjectMember_Finalize, nsnull, nsnull, NPObjectMember_Call,
220
    NPObjectMember_Finalize, nsnull, nsnull, NPObjectMember_Call,
221
    nsnull, nsnull, nsnull, NPObjectMember_Mark, nsnull
221
    nsnull, nsnull, nsnull, NPObjectMember_Mark, nsnull
 Lines 1248-1254   NPObjWrapper_DelProperty(JSContext *cx, Link Here 
1248
}
1248
}
1249
1249
1250
static JSBool
1250
static JSBool
1251
NPObjWrapper_SetProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
1251
NPObjWrapper_SetProperty(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
1252
{
1252
{
1253
  NPObject *npobj = GetNPObject(cx, obj);
1253
  NPObject *npobj = GetNPObject(cx, obj);
1254
1254

Return to bug 537873