This repository was archived by the owner on Feb 26, 2024. It is now read-only.
fix(element): Fix native_shim.js not implement adoptedCallback error.#1179
Merged
vikerman merged 1 commit intoangular:masterfrom Jan 22, 2019
Merged
fix(element): Fix native_shim.js not implement adoptedCallback error.#1179vikerman merged 1 commit intoangular:masterfrom
vikerman merged 1 commit intoangular:masterfrom
Conversation
gkalpak
reviewed
Jan 19, 2019
| descriptor.value = wrapWithCurrentZone(descriptor.value, source); | ||
| _redefineProperty(opts.prototype, callback, descriptor); | ||
| } else { | ||
| } else if (prototype[callback]) { |
Member
There was a problem hiding this comment.
There is already a check for prototype.hasOwnProperty(callback) a few lines above.
Does it mean that the properties exists, but are falsy? (That would be unexpected.)
Collaborator
Author
There was a problem hiding this comment.
Yes, hasOwnProperty return true, but prototype[call back] is undefined.
Some case like this.
var a = {
key: undefined
};
console.log('hasOwnProperty', a.hasOwnProperty('key')); // output is true
console.log('prop', a.key); // output is undefined.
gkalpak
approved these changes
Jan 20, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To pass test in
angular, we need to handle some ofcallbacksare not implemented by somepolyfilles.@webcomponent/native_shim.jsdoesn't implementadopdatedCallback,zone.jswill throw error, so we need to check this case.