Permalink
Browse files

Only warn once for dojo.getObject

  • Loading branch information...
danconn committed Mar 26, 2013
1 parent a98d7ff commit 993e98cbc9056a50a5d1a95665739357bfa6d2b6
Showing with 10 additions and 4 deletions.
  1. +10 −4 converter.js
View
@@ -133,10 +133,16 @@ this.CONVERTER = (function () {
{
pattern: /dojo\.(getObject)/g,
depend: 'dojo/_base/lang',
- repFn: function (all) {
- warn('WARNING: All instances of dojo.getObject replaced with dojoLang.getObject. However, getObject ' +
- 'relies on globals - refactor to make dojo.getObject unnecessary');
- }
+ repFn: (function (all) {
+ var alreadyWarned = false;
+ return function () {
+ if (!alreadyWarned) {
+ warn('WARNING: All instances of dojo.getObject replaced with dojoLang.getObject. However, getObject ' +
+ 'relies on globals - refactor to make dojo.getObject unnecessary');
+ }
+ alreadyWarned = true;
+ };
+ }())
},
{
pattern: /dojo\.isIE/g,

0 comments on commit 993e98c

Please sign in to comment.