Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage native WeakMaps #15878

Merged
merged 1 commit into from
Nov 29, 2017
Merged

Leverage native WeakMaps #15878

merged 1 commit into from
Nov 29, 2017

Conversation

sivakumar-kailasam
Copy link
Member

@sivakumar-kailasam sivakumar-kailasam commented Nov 29, 2017

Part of #15876

@rwjblue
Copy link
Member

rwjblue commented Nov 29, 2017

Since beta is 2.18, the commit message should either be [CLEANUP] or [CLEANUP canary] would you mind updating (also, I have no clue which is better?)...

@rwjblue rwjblue mentioned this pull request Nov 29, 2017
34 tasks
@sivakumar-kailasam
Copy link
Member Author

Done. I liked cleanup better, helps in reading commit messages on any branch 😄


setMeta = function WeakMap_setMeta(obj, meta) {
let setMeta = function WeakMap_setMeta(obj, meta) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we no longer need to swap based on environment, lets clean things up a bit and make these:

export function setMeta(obj, meta) {
  // ...snip...
}

export function peekMeta(obj, meta) {
  // ...snip...
}

Then we can remove the export { setMeta, peekMeta } at the end of the file too...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@sivakumar-kailasam
Copy link
Member Author

Its our good old friend,

not ok 1 SL_IE_10 - https://saucelabs.com/jobs/ae05d4adcf3245e4a2fb7065cb235b40
not ok 2 SL_IE_9 - https://saucelabs.com/jobs/db8c7c1c062f4b6185508bc0d2795b50

@sivakumar-kailasam
Copy link
Member Author

https://saucelabs.com/beta/tests/ae05d4adcf3245e4a2fb7065cb235b40/jsunit doesn’t seem to have test details. I'll run these against browserstack to hopefully get more details.

@thoov
Copy link
Member

thoov commented Nov 29, 2017

@sivakumar-kailasam This is most likely because Window.WeakMap does not exist on IE 9/10. Since 3.0 will be dropping support for these we should probably not test against them.

@thoov
Copy link
Member

thoov commented Nov 29, 2017

This issue should be fixed with: #15879

@rwjblue
Copy link
Member

rwjblue commented Nov 29, 2017

Merged, can you rebase?

@@ -139,9 +138,6 @@ Ember.bind = metal.bind;
Ember.Binding = metal.Binding;
Ember.isGlobalPath = metal.isGlobalPath;

if (EMBER_METAL_WEAKMAP) {
Ember.WeakMap = metal.WeakMap;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be put behind a deprecate method for the remainder of 2.X?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. @rwjblue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thoov - The feature flag was never enabled, so it has never been published and usable by users. AFAIK all users of this have to go through ember-weakmap which detects if Ember.WeakMap is set or else defines it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants