Skip to content

zone.js propertyPatch breaks spread for objects with Symbol keys. #44095

Closed
@wesselvdv

Description

@wesselvdv

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

When compiling with optimizations: true in angular.json it'll enable esbuild which will transpile to ES2015 which causes spreads to be replaced with a polyfill. zone.js has a property patch that overrides Object.defineProperties where it's using Object.keys() to iterate over the properties of the object to merge into the spread. This causes all symbol keys to be omitted: Object.keys({ a: 1, b: Symbol() }) === ['a']

Object.defineProperties = function(obj, props) {
Object.keys(props).forEach(function(prop) {
Object.defineProperty(obj, prop, props[prop]);
});
return obj;
};

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions