Skip to content

PromiseRejectionEvent does not conform to spec again #1509

@l1bbcsg

Description

@l1bbcsg
  1. What version of bluebird is the issue happening on?
    3.5.1

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32)
    Testing in Chrome 67, but it's irrelevant

  3. Did this issue happen with earlier version of bluebird?
    Do not know

Event objects fired with unhandledrejection and rejectionhandled do not conform to PromiseRejectionEvent specification: They do not have reason and promise properties, instead they have detail property which contains the two.

This issue was already raised as #1447 and fixed in #1464
And evidently the code is still there in master.

But it's gone in the build.
Here's the snipped from bluebird.core.js as compiled by default and as linked on the site (https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.js):

		var fireDomEvent = (function() {
			try {
				if (typeof CustomEvent === "function") {
					var event = new CustomEvent("CustomEvent");
					util.global.dispatchEvent(event);
					return function(name, event) {
						var domEvent = new CustomEvent(name.toLowerCase(), {
							detail: event,
							cancelable: true
						});
						return !util.global.dispatchEvent(domEvent);
					};
				} else if (typeof Event === "function") {
// ...

For some reasons, property defines are gone.
I imagine this is either issue with build scripts or es5.defineProperty shim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions