function wrapCreateMethod(name, typeName, opt_arg) {
    var signature =
        name + '(' + (opt_arg ? opt_arg + ', ' : '') +
        'uint32 ' + typeName + ')';
    wrapContextMethod(signature, function(fn, eventType) {
      return function(arg) {
        setCurrentContext(this);
        var id = provider.nextObjectId_++;
        if (opt_arg) {
          leaveScope(eventType(arg, id));
        } else {
          leaveScope(eventType(id));
        }
        var obj = fn.apply(this, arguments);
        if (obj) {
          setHandle(obj, id);
        }
        return obj;
      };
    });
  }
@param {string} name Method name, like 'createProgram'.
@param {string} typeName Type name, like 'program'.
@param {string=} opt_arg Argument.