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

Diff of /trunk/js/jsbool.h

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

revision 460 by siliconforks, Sat Sep 26 23:15:22 2009 UTC revision 507 by siliconforks, Sun Jan 10 07:23:34 2010 UTC
# Line 48  Line 48 
48  JS_BEGIN_EXTERN_C  JS_BEGIN_EXTERN_C
49    
50  /*  /*
51   * Pseudo-booleans, not visible to script but used internally by the engine.   * Special values, not visible to script but used internally by the engine.
52   *   *
53   * JSVAL_HOLE is a useful value for identifying a hole in an array.  It's also   * JSVAL_HOLE is a useful value for identifying a hole in an array.  It's also
54   * used in the interpreter to represent "no exception pending".  In general it   * used in the interpreter to represent "no exception pending".  In general it
55   * can be used to represent "no value".   * can be used to represent "no value".
56   *   *
57   * A JSVAL_HOLE can be cheaply converted to undefined without affecting any   * A JSVAL_HOLE can be cheaply converted to undefined without affecting any
58   * other boolean (or pseudo boolean) by masking out JSVAL_HOLE_MASK.   * other boolean (or special value) by masking out JSVAL_HOLE_FLAG.
59   *   *
60   * JSVAL_ARETURN is used to throw asynchronous return for generator.close().   * JSVAL_ARETURN is used to throw asynchronous return for generator.close().
61   *   *
62   * NB: PSEUDO_BOOLEAN_TO_JSVAL(2) is JSVAL_VOID (see jsapi.h).   * NB: SPECIAL_TO_JSVAL(2) is JSVAL_VOID (see jsapi.h).
63   */   */
64  #define JSVAL_HOLE_FLAG jsval(4 << JSVAL_TAGBITS)  #define JSVAL_HOLE_FLAG jsval(4 << JSVAL_TAGBITS)
65  #define JSVAL_HOLE      (JSVAL_VOID | JSVAL_HOLE_FLAG)  #define JSVAL_HOLE      (JSVAL_VOID | JSVAL_HOLE_FLAG)
66  #define JSVAL_ARETURN   PSEUDO_BOOLEAN_TO_JSVAL(8)  #define JSVAL_ARETURN   SPECIAL_TO_JSVAL(8)
   
 static JS_ALWAYS_INLINE JSBool  
 JSVAL_TO_PUBLIC_PSEUDO_BOOLEAN(jsval v)  
 {  
     JS_ASSERT(v == JSVAL_TRUE || v == JSVAL_FALSE || v == JSVAL_VOID);  
     return JSVAL_TO_PSEUDO_BOOLEAN(v);  
 }  
67    
68  extern JSClass js_BooleanClass;  extern JSClass js_BooleanClass;
69    
# Line 81  Line 74 
74  js_BooleanToString(JSContext *cx, JSBool b);  js_BooleanToString(JSContext *cx, JSBool b);
75    
76  extern JSBool  extern JSBool
77    js_BooleanToCharBuffer(JSContext *cx, JSBool b, JSCharBuffer &cb);
78    
79    extern JSBool
80  js_ValueToBoolean(jsval v);  js_ValueToBoolean(jsval v);
81    
82  JS_END_EXTERN_C  JS_END_EXTERN_C

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

  ViewVC Help
Powered by ViewVC 1.1.24