@@ -48,56 +48,4 @@ module.exports = () => {
48
48
makeCallback ( resource , process , myMultiArgFunc , 1 , 2 , 3 ) ,
49
49
42
50
50
) ;
51
-
52
- // TODO(node-api): napi_make_callback needs to support
53
- // strings passed for the func argument
54
- //
55
- // const recv = {
56
- // one: function () {
57
- // assert.strictEqual(0, arguments.length);
58
- // assert.strictEqual(this, recv);
59
- // return 42;
60
- // },
61
- // two: function (x) {
62
- // assert.strictEqual(1, arguments.length);
63
- // assert.strictEqual(this, recv);
64
- // assert.strictEqual(x, 1339);
65
- // return 42;
66
- // },
67
- // };
68
-
69
- // assert.strictEqual(makeCallback(recv, "one"), 42);
70
- // assert.strictEqual(makeCallback(recv, "two", 1337), 42);
71
- //
72
- // Check that callbacks on a receiver from a different context works.
73
- // const foreignObject = vm.runInNewContext('({ fortytwo() { return 42; } })');
74
- // const foreignObject = { fortytwo: () => 42 };
75
- // assert.strictEqual(makeCallback(foreignObject, "fortytwo"), 42);
76
-
77
- // Check that the callback is made in the context of the receiver.
78
-
79
- // const target = vm.runInNewContext(`
80
- // (function($Object) {
81
- // if (Object === $Object)
82
- // throw new Error('bad');
83
- // return Object;
84
- // })
85
- // `);
86
- // assert.notStrictEqual(makeCallback(resource, process, target, Object), Object);
87
-
88
- // // Runs in inner context.
89
- // const forward = vm.runInNewContext(`
90
- // (function(forward) {
91
- // return forward(Object);
92
- // })
93
- // `);
94
-
95
- // // Runs in outer context.
96
- // function endpoint($Object) {
97
- // if (Object === $Object)
98
- // throw new Error('bad');
99
- // return Object;
100
- // }
101
-
102
- // assert.strictEqual(makeCallback(resource, process, forward, endpoint), Object);
103
51
} ;
0 commit comments