Skip to content

Commit

Permalink
Add window to IE9 console test
Browse files Browse the repository at this point in the history
  • Loading branch information
daviferreira committed Mar 18, 2015
1 parent 3a0cc5e commit b3eda18
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/js/medium-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ var Util;

deprecatedMethod: function (oldName, newName, args) {
// Thanks IE9, you're the best
if (console) {
if (window.console !== undefined) {
console.warn(oldName +
' is deprecated and will be removed, please use ' +
newName +
Expand Down
2 changes: 1 addition & 1 deletion dist/js/medium-editor.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions spec/util.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ describe('Util', function () {

describe('Deprecated', function () {
it('should warn when a method is deprecated', function () {
// IE9 mock for SauceLabs
if (window.console === undefined) {
window.console = {
warn: function (msg) {
return msg;
}
};
}
var testObj = {
newMethod: function () {}
};
Expand Down
2 changes: 1 addition & 1 deletion src/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ var Util;

deprecatedMethod: function (oldName, newName, args) {
// Thanks IE9, you're the best
if (console) {
if (window.console !== undefined) {
console.warn(oldName +
' is deprecated and will be removed, please use ' +
newName +
Expand Down

0 comments on commit b3eda18

Please sign in to comment.