Bug 514585: Move 'grouped' to explicit param of JS_NEW_PRINTER. r=igor
Make all the JSPrinter status bits explicit flags to JS_NEW_PRINTER. Only in public-facing functions like JS_DecompileFunction should we be peeling bits out of indent values and turning them into flags; internally, we can change interfaces to make more sense. This is preparation for adding another flag to JS_NEW_PRINTER.
This commit is contained in:
@@ -276,16 +276,16 @@ js_QuoteString(JSContext *cx, JSString *str, jschar quote);
|
||||
*/
|
||||
|
||||
#ifdef JS_ARENAMETER
|
||||
# define JS_NEW_PRINTER(cx, name, fun, indent, pretty) \
|
||||
js_NewPrinter(cx, name, fun, indent, pretty)
|
||||
# define JS_NEW_PRINTER(cx, name, fun, indent, pretty, grouped) \
|
||||
js_NewPrinter(cx, name, fun, indent, pretty, grouped)
|
||||
#else
|
||||
# define JS_NEW_PRINTER(cx, name, fun, indent, pretty) \
|
||||
js_NewPrinter(cx, fun, indent, pretty)
|
||||
# define JS_NEW_PRINTER(cx, name, fun, indent, pretty, grouped) \
|
||||
js_NewPrinter(cx, fun, indent, pretty, grouped)
|
||||
#endif
|
||||
|
||||
extern JSPrinter *
|
||||
JS_NEW_PRINTER(JSContext *cx, const char *name, JSFunction *fun,
|
||||
uintN indent, JSBool pretty);
|
||||
uintN indent, JSBool pretty, JSBool grouped);
|
||||
|
||||
extern void
|
||||
js_DestroyPrinter(JSPrinter *jp);
|
||||
@@ -427,6 +427,11 @@ js_DecompileFunctionBody(JSPrinter *jp);
|
||||
extern JSBool
|
||||
js_DecompileFunction(JSPrinter *jp);
|
||||
|
||||
extern JSString *
|
||||
js_DecompileToString(JSContext *cx, const char *name, JSFunction *fun,
|
||||
uintN indent, JSBool pretty, JSBool grouped,
|
||||
JSBool (*decompiler)(JSPrinter *jp));
|
||||
|
||||
/*
|
||||
* Find the source expression that resulted in v, and return a newly allocated
|
||||
* C-string containing it. Fall back on v's string conversion (fallback) if we
|
||||
|
||||
Reference in New Issue
Block a user