michael@0: function run_test() { michael@0: var Cu = Components.utils; michael@0: michael@0: var handler = { michael@0: get: function(target, name){ michael@0: return name in target? michael@0: target[name] : michael@0: 37; michael@0: } michael@0: }; michael@0: michael@0: var p = new Proxy({}, handler); michael@0: do_check_true(Cu.isProxy(p)); michael@0: do_check_false(Cu.isProxy({})); michael@0: do_check_false(Cu.isProxy(42)); michael@0: michael@0: sb = new Cu.Sandbox(this, michael@0: { wantExportHelpers: true }); michael@0: michael@0: do_check_false(Cu.isProxy(sb)); michael@0: michael@0: sb.do_check_true = do_check_true; michael@0: sb.do_check_false = do_check_false; michael@0: sb.p = p; michael@0: Cu.evalInSandbox('do_check_true(isProxy(p));' + michael@0: 'do_check_false(isProxy({}));' + michael@0: 'do_check_false(isProxy(42));', michael@0: sb); michael@0: }