register method
注册 plugin 并返回当前 Registry 以支持链式配置。
Implementation
JsPluginRegistry register(JsPlugin plugin) {
final previous = _plugins[plugin.manifest.id];
if (previous != null && !identical(previous, plugin)) {
throw JsValueConversionException(
'QuickJS plugin is already registered: ${plugin.manifest.id}',
);
}
_plugins[plugin.manifest.id] = plugin;
return this;
}