blob: b821d92a9eb668c42cc9f395fb176004be7f3c33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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');
|