/[jscoverage]/trunk/js/jsbool.cpp
ViewVC logotype

Diff of /trunk/js/jsbool.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 332 by siliconforks, Thu Oct 23 19:03:33 2008 UTC revision 460 by siliconforks, Sat Sep 26 23:15:22 2009 UTC
# Line 48  Line 48 
48  #include "jsbool.h"  #include "jsbool.h"
49  #include "jscntxt.h"  #include "jscntxt.h"
50  #include "jsversion.h"  #include "jsversion.h"
 #include "jsinterp.h"  
51  #include "jslock.h"  #include "jslock.h"
52  #include "jsnum.h"  #include "jsnum.h"
53  #include "jsobj.h"  #include "jsobj.h"
54  #include "jsstr.h"  #include "jsstr.h"
55    
56  /* Check pseudo-booleans values. */  /* Check pseudo-booleans values. */
57  JS_STATIC_ASSERT(JSVAL_VOID == JSVAL_TRUE + JSVAL_ALIGN);  JS_STATIC_ASSERT(!(JSVAL_TRUE & JSVAL_HOLE_FLAG));
58  JS_STATIC_ASSERT(JSVAL_HOLE == JSVAL_VOID + JSVAL_ALIGN);  JS_STATIC_ASSERT(!(JSVAL_FALSE & JSVAL_HOLE_FLAG));
59  JS_STATIC_ASSERT(JSVAL_ARETURN == JSVAL_HOLE + JSVAL_ALIGN);  JS_STATIC_ASSERT(!(JSVAL_VOID & JSVAL_HOLE_FLAG));
60    JS_STATIC_ASSERT((JSVAL_HOLE & JSVAL_HOLE_FLAG));
61    JS_STATIC_ASSERT((JSVAL_HOLE & ~JSVAL_HOLE_FLAG) == JSVAL_VOID);
62    JS_STATIC_ASSERT(!(JSVAL_ARETURN & JSVAL_HOLE_FLAG));
63    
64  JSClass js_BooleanClass = {  JSClass js_BooleanClass = {
65      "Boolean",      "Boolean",
# Line 121  Line 123 
123  #endif  #endif
124      JS_FN(js_toString_str,  bool_toString,  0, JSFUN_THISP_BOOLEAN),      JS_FN(js_toString_str,  bool_toString,  0, JSFUN_THISP_BOOLEAN),
125      JS_FN(js_valueOf_str,   bool_valueOf,   0, JSFUN_THISP_BOOLEAN),      JS_FN(js_valueOf_str,   bool_valueOf,   0, JSFUN_THISP_BOOLEAN),
126        JS_FN(js_toJSON_str,    bool_valueOf,   0, JSFUN_THISP_BOOLEAN),
127      JS_FS_END      JS_FS_END
128  };  };
129    
# Line 132  Line 135 
135      bval = (argc != 0)      bval = (argc != 0)
136             ? BOOLEAN_TO_JSVAL(js_ValueToBoolean(argv[0]))             ? BOOLEAN_TO_JSVAL(js_ValueToBoolean(argv[0]))
137             : JSVAL_FALSE;             : JSVAL_FALSE;
138      if (!(cx->fp->flags & JSFRAME_CONSTRUCTING)) {      if (!JS_IsConstructing(cx)) {
139          *rval = bval;          *rval = bval;
140          return JS_TRUE;          return JS_TRUE;
141      }      }

Legend:
Removed from v.332  
changed lines
  Added in v.460

  ViewVC Help
Powered by ViewVC 1.1.24