The docs are broken; they are missing a `new` before `broadcast(i,
message)`.
Right now it just puts an `i` on the global scope in sloppy mode; strict
mode prevents this error.
On Thursday, October 10, 2013 2:15:16 PM UTC+2, Ket wrote:
>
> Hello,
>
> I try to send data with the child_process function in a "use strict" mode
> with the code below:
>
> normal.send("socket", broadcast(i, message));
>>
>> var broadcast = function(i, message) {
>> this.i = i;
>> this.message = message;
>> var sendData = function(i, message) {
>> this.i = i;
>> this.message = message;
>> this.sending(i, message);
>> }
>> sendData.prototype.sending = function(i, message){
>> this.i.send(this.message, {
>> mask: false
>> });
>> }
>> var sent = new sendData(i, message);
>> }
>>
>
> provided i = connections.
>
> It works perfectly without the "use strict", but it throw this error with
> the mode in action (the error part).
>
> this.i ^= i;
>>
>> Cannot set property 'i' of undefined
>>
>
> Any idea why the error?
> The code is taken from here:
> http://nodejs.org/api/child_process.html#child_process_example_sending_socket_object
>
> Thank you,
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.