Last Comment Bug 760555 - Remove JSVAL_IS_OBJECT from the source tree.
: Remove JSVAL_IS_OBJECT from the source tree.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla15
Assigned To: Tom Schuster [:evilpie]
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-01 09:11 PDT by Tom Schuster [:evilpie]
Modified: 2012-06-03 12:13 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Remove JSVAL_IS_OBJECT (3.04 KB, patch)
2012-06-01 09:11 PDT, Tom Schuster [:evilpie]
dmandelin: review+
Details | Diff | Splinter Review

Description Tom Schuster [:evilpie] 2012-06-01 09:11:26 PDT
Created attachment 629214 [details] [diff] [review]
Remove JSVAL_IS_OBJECT

People still introduce new uses of JSVAL_IS_OBJECT, which are again incorrect. (See http://dxr.lanedo.com/mozilla-central/dom/system/OSFileConstants.cpp.html#l258).

I am not a fan of breaking the API, but I would guess even embedders get this wrong. JSVAL_TO_OBJECT is going to be removed a bit later.
Comment 1 :Ms2ger (⌚ UTC+1/+2) 2012-06-01 09:20:44 PDT
Comment on attachment 629214 [details] [diff] [review]
Remove JSVAL_IS_OBJECT

Review of attachment 629214 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/OSFileConstants.cpp
@@ +257,5 @@
>   */
>  JSObject *GetOrCreateObjectProperty(JSContext *cx, JSObject *aObject,
>                                      const char *aProperty)
>  {
> +  js::Value val;

JS::Value

@@ +259,5 @@
>                                      const char *aProperty)
>  {
> +  js::Value val;
> +  if (!JS_GetProperty(cx, aObject, aProperty, &val))
> +    return NULL;

{}

@@ +263,5 @@
> +    return NULL;
> +
> +  if (!val.isUndefined()) {
> +    if (val.isObject())
> +      return &val.toObject();

{}
Comment 2 David Mandelin [:dmandelin] 2012-06-01 11:18:34 PDT
Comment on attachment 629214 [details] [diff] [review]
Remove JSVAL_IS_OBJECT

Review of attachment 629214 [details] [diff] [review]:
-----------------------------------------------------------------

r+ on the jseng part. Please do address Ms2ger's comments on the DOM part.
Comment 3 Tom Schuster [:evilpie] 2012-06-02 11:35:28 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/2f02e08e634c
Landed but referred to the wrong bug :/
Comment 4 Phil Ringnalda (:philor) 2012-06-03 12:13:40 PDT
https://hg.mozilla.org/mozilla-central/rev/2f02e08e634c

Note You need to log in before you can comment on or make changes to this bug.