Skip to content

Commit

Permalink
Naming collision detection during model deserialization + fix i.e. sk…
Browse files Browse the repository at this point in the history
…ipping func registration if prop of the same name already exists.
  • Loading branch information
jwaliszko committed Aug 9, 2017
1 parent c01b93a commit f39e431
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/expressive.annotations.validate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* expressive.annotations.validate.js - v2.7.1
/* expressive.annotations.validate.js - v2.7.2
* Client-side component of ExpressiveAnnotations - annotation-based conditional validation library.
* https://github.com/jwaliszko/ExpressiveAnnotations
*
Expand Down Expand Up @@ -128,6 +128,10 @@ var
this.initialize();
for (name in this.methods) {
if (this.methods.hasOwnProperty(name)) {
if (model.hasOwnProperty(name)) {
logger.warn(typeHelper.string.format('Skipping {0} function registration due to naming conflict (property of the same name already defined within the context).', name));
continue;
}
body = this.methods[name];
model[name] = body;
}
Expand Down
Loading

0 comments on commit f39e431

Please sign in to comment.