Bug 514585: Recognize "use strict" directives. r=igor

This commit is contained in:
Jim Blandy
2009-11-18 13:33:53 -08:00
parent d48dccd251
commit 77964ebbf2
12 changed files with 151 additions and 21 deletions

View File

@@ -273,11 +273,16 @@ js_QuoteString(JSContext *cx, JSString *str, jschar quote);
* JSPrinter operations, for printf style message formatting. The return
* value from js_GetPrinterOutput() is the printer's cumulative output, in
* a GC'ed string.
*
* strict is true if the context in which the output will appear has
* already been marked as strict, thus indicating that nested
* functions need not be re-marked with a strict directive. It should
* be false in the outermost printer.
*/
extern JSPrinter *
js_NewPrinter(JSContext *cx, const char *name, JSFunction *fun,
uintN indent, JSBool pretty, JSBool grouped);
uintN indent, JSBool pretty, JSBool grouped, JSBool strict);
extern void
js_DestroyPrinter(JSPrinter *jp);
@@ -421,7 +426,7 @@ js_DecompileFunction(JSPrinter *jp);
extern JSString *
js_DecompileToString(JSContext *cx, const char *name, JSFunction *fun,
uintN indent, JSBool pretty, JSBool grouped,
uintN indent, JSBool pretty, JSBool grouped, JSBool strict,
JSBool (*decompiler)(JSPrinter *jp));
/*