0

我无法理解Classy框架中的以下几行:

/* we check if $super is in use by a class if we can.  But first we have to
 check if the JavaScript interpreter supports that.  This also matches
 to false positives later, but that does not do any harm besides slightly
 slowing calls down. */
  var probe_super = (function(){$super();}).toString().indexOf('$super') > 0;
  function usesSuper(obj) {
    return !probe_super || /\B\$super\b/.test(obj.toString());
  }

何时以及如何使 probe_super 返回 false?

4

1 回答 1

0

正如评论所说,它是检查 JavaScript 解释器是否支持它,所以你不能对它做任何事情,这取决于 JavaScript 解释器。

于 2012-06-04T03:45:56.313 回答