ljharb / object.assign

ES6 spec-compliant Object.assign shim. From https://github.com/es-shims/es6-shim
https://tc39.es/ecma262/#sec-object.assign
MIT License
107 stars 22 forks source link

[Tests] ses-compat - create polyfill wrapper if using intrinsic Object.assign #77

Closed kumavis closed 3 years ago

kumavis commented 3 years ago

the issue is that when Object.assign is present, this package appends additional properties to it, like getPolyfill. under SES, this has been hardened and you cannot append the properties

kumavis commented 3 years ago

some tests from es-shim-api fails

kumavis commented 3 years ago
not ok 3 module.exports === getPolyfill()
not ok 10 shim returns polyfill (pass `--skip-shim-returns-polyfill` to skip this test)
kumavis commented 3 years ago

ok it works :+1:

kumavis commented 3 years ago

@ljharb ready for review

ljharb commented 3 years ago

Rather than alter the getPolyfill result - for which it's important it's === to Object.assign as often as possible - I've updated this PR to wrap the index.js entrypoint instead.

kumavis commented 3 years ago

sounds good but hold up some of my commits got lost

kumavis commented 3 years ago

so i like your version but it doesnt pass tests

ljharb commented 3 years ago

Looking into it.

kumavis commented 3 years ago

tests pass here https://github.com/ljharb/object.assign/pull/78

kumavis commented 3 years ago

I like your approach, and expect your tests to pass :+1:

ljharb commented 3 years ago

Looks like ses fails in node < 4 due to its use of const, and node < 12 due to its use of globalThis, which is disappointing. I'll try a tweaked approach.

ljharb commented 3 years ago

v4.1.1 is released.