shim CustomEvent constructor