anchor.diff:  -export([exports/1,init/1]).
   -behaviour(erlv8_module).
   -include_lib("erlv8/include/erlv8.hrl").
  -%-behaviour(gen_server2).
  -%% gen_server2 callbacks
  --export([handle_call/3, handle_cast/2, handle_info/2,
  -		 terminate/2, code_change/3]).
  -
   
   init({gen_server2,This, Emitter}) ->
   	{ok, {This, Emitter}};
  
positive.code: 	ok.
  
  exports(_VM) ->
   	?V8Obj([{"Mailbox", fun new_mailbox/2}]).
  	
  prototype() ->
  	?V8Obj([{"send", fun send/2}]).
  
  
  new_mailbox(#erlv8_fun_invocation{}=I,[]) ->
  	new_mailbox(I,[noname]);
  
  
negative.code: 
  	EventEmitterCtor:call(This,[]),
  
  	Prototype = This:get_prototype(),
  	Prototype:set_prototype(beamjs_mod_events:prototype_EventEmitter()), %% FIXME?
  	Emitter = This:get_value("emit"),
  
  	Pid = spawn(fun () -> mailbox(This, Emitter) end),
  	This:set_hidden_value("mailboxServer", Pid),
  
  	case OptsOrName of
  		Name when is_list(Name) ->
  			register(list_to_atom(Name), Pid), ok;
  		{erlv8_object,_,_} ->
  			case  OptsOrName:get_value("global") of
  				undefined ->
  					{throw, {error, "new Mailbox() accepts either zero arguments or a string, or {global: string}"}};
  				GlobalName ->
  					case global:register_name(GlobalName, Pid) of
  						yes ->
  							true;
  						no ->
  							{throw, {error, "Wasn't able to register a global name " ++ GlobalName }}
  					end
  			end
  	end.
  
  send(#erlv8_fun_invocation{},[Name, Data]) when is_list(Name) ->
  	list_to_existing_atom(Name) ! Data;
  