diff options
Diffstat (limited to 'js/src/tests/js1_8_5/reflect-parse/proxyArgs.js')
-rw-r--r-- | js/src/tests/js1_8_5/reflect-parse/proxyArgs.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/js1_8_5/reflect-parse/proxyArgs.js b/js/src/tests/js1_8_5/reflect-parse/proxyArgs.js new file mode 100644 index 000000000..b821d92a9 --- /dev/null +++ b/js/src/tests/js1_8_5/reflect-parse/proxyArgs.js @@ -0,0 +1,22 @@ +// |reftest| skip-if(!xulRuntime.shell) +// |reftest| skip-if(!xulRuntime.shell) +// bug 905774 + +// Proxy options +var opts = new Proxy({loc: false}, {}); +assertEq(Reflect.parse("0;", opts).loc === null, true); +opts.loc = true; +assertEq(Reflect.parse("0;", opts).loc !== null, true); +delete opts.loc; +assertEq(Reflect.parse("0;", opts).loc !== null, true); // default is true + +// Proxy builder +var builder = { + program: function (body) { return body.join(); }, + expressionStatement: function (expr) { return expr + ";" }, + literal: function (val) { return "" + val; } +}; +opts = {builder: new Proxy(builder, {})}; +assertEq(Reflect.parse("0xff;", opts), "255;"); + +reportCompare(0, 0, 'ok'); |