Skip to content

Commit

Permalink
Partial fix for aurelia#22
Browse files Browse the repository at this point in the history
Make sure that __metadata__ is the target own property and not something inherited from its prototype (important for class inheritance).
  • Loading branch information
jods4 committed Aug 10, 2015
1 parent 8edc239 commit d0ba85e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(typeof theGlobal.Reflect.getOwnMetadata === 'undefined'){

if(typeof theGlobal.Reflect.defineMetadata === 'undefined'){
Reflect.defineMetadata = function(metadataKey, metadataValue, target, targetKey){
var metadataContainer = target[metadataContainerKey] || (target[metadataContainerKey] = {});
var metadataContainer = target.hasOwnProperty(metadataContainerKey) ? target[metadataContainerKey] : (target[metadataContainerKey] = {});
var targetContainer = metadataContainer[targetKey] || (metadataContainer[targetKey] = {});
targetContainer[metadataKey] = metadataValue;
};
Expand Down

0 comments on commit d0ba85e

Please sign in to comment.