Skip to content

Commit

Permalink
feat: wrap importSync in try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
BobrImperator committed Apr 3, 2023
1 parent 9877f83 commit d830196
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ember-simple-auth/addon/utils/assign.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { macroCondition, dependencySatisfies, importSync } from '@embroider/macros';
import { importSync } from '@embroider/macros';

let assign;

if (macroCondition(dependencySatisfies('ember-source', '<5.x'))) {
try {
assign = importSync('@ember/polyfills').assign;
} catch (error) {
// Couldn't import @ember/polyfills
// Doesn't exist in v5
}

export default Object.assign || assign;

0 comments on commit d830196

Please sign in to comment.