Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__defineGetter__ is not supported in IE9 & IE10 #1244

Closed
eternalsky opened this issue Jan 13, 2017 · 1 comment
Closed

__defineGetter__ is not supported in IE9 & IE10 #1244

eternalsky opened this issue Jan 13, 2017 · 1 comment
Assignees

Comments

@eternalsky
Copy link

sinon 2.x is used in my project tests, and the tests fail in IE9 & IE10 because defineGetter is used. So does sinon 2.x just support IE >= 11 ?

@fatso83 fatso83 self-assigned this Jan 13, 2017
@fatso83
Copy link
Contributor

fatso83 commented Jan 13, 2017

@eternalsky, you can follow the discussion in #1221, but Sinon 2 does focus on newer browsers than Sinon 1. If you need support for older browsers then just use that. That being said, I don't think we have landet on a minimum version of IE to support, but then Sinon 2 is still in pre-release so that is our privilege 😄

As to your problem, defineGetter is not used at all in the source, but I see now that it is part of the packaged builds for the browser, which means it is from one of the packages we depend on:

$  git grep defineGetter | wc -l
       0

$ ag -B10 defineGetter pkg/sinon.js

76-
5377-},{}],44:[function(require,module,exports){
5378-var colors = require('./colors');
5379-
5380-module['exports'] = function () {
5381-
5382-  //
5383-  // Extends prototype of native string object to allow for "foo".red syntax
5384-  //
5385-  var addProperty = function (color, func) {
5386:    String.prototype.__defineGetter__(color, func);
5435-      return colors.stylize(this, style);
5436-    });
5437-  });
5438-
5439-  function applyTheme(theme) {
5440-    //
5441-    // Remark: This is a list of methods that exist
5442-    // on String that you should not overwrite.
5443-    //
5444-    var stringPrototypeBlacklist = [
5445:      '__defineGetter__', '__defineSetter__', '__looku

As can be seen it has something to do with colors, which was introduced in 4160e14 (PR #1203), so this is a regression. But if it is a regression worth fixing is another thing. If we land on IE11 as the min version (which I think is reasonable given that Sinon 1 support older versions), then we should't invest time in fixing it.

But ... if I were you I'd try to submit a small patch to the colors project that removes the deprecated __defineGetter__ in favor of Object.defineProperty and then get us to upgrade our version afterwards. That would fix this issue as well.

@fatso83 fatso83 closed this as completed Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants