It works this way but a valid method name is addScript https://github.com/owncloud/core/blob/master/lib/util.php#L108