ie8polyfill.js报错 #913

Closed
areyouse7en opened this Issue Aug 19, 2016 · 4 comments

Projects

None yet

3 participants

@areyouse7en

/*! Amaze UI v2.7.2 ~ IE8 Fucker | by Amaze UI Team | (c) 2016 AllMobilize, Inc. | Licensed under MIT | 2016-08-17T16:17:24+0800 */

源生ie8下,报错。
2466行 throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);

换了几个版本了,都是报这一行的错,看了下定义。

var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';

求解决。

@minwe
Contributor
minwe commented Aug 19, 2016

你在什么场景下遇到的?有演示地址吗?

@areyouse7en

空页面在ie8下打开,就报错

<body>
    <script src='amazeui/js/amazeui.ie8polyfill.js'></script>
</body>
@areyouse7en

我再描述一下,源深ie8下,我用avalon,只是定义vm而已就报错了。
报错是defineProperty的兼容代码抛出的,

if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) {
        throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
    }

网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
时间戳: Sat, 20 Aug 2016 05:57:26 UTC

消息: 例外被抛出且未被接住
行: 2466
字符: 17
代码: 0
URI: http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.ie8polyfill.js

我引用的js如下

<script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.ie8polyfill.js"></script>
<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
<script src="http://cdn.bootcss.com/avalon.js/2.1.5/avalon.min.js"></script>
<script src="http://cdn.bootcss.com/es6-promise/3.2.2/es6-promise.min.js"></script>
<script>
    var vm = avalon.define({
        $id: 'vm'
    })
</script>
<ms-controller="vm"></div>
@lwxyfer lwxyfer added the bug label Aug 22, 2016
@minwe
Contributor
minwe commented Aug 22, 2016
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
  <script src="http://cdn.bootcss.com/avalon.js/2.1.5/avalon.min.js"></script>
  <script src="//cdn.bootcss.com/es5-shim/4.5.9/es5-sham.js"></script>
  <script src="//cdn.bootcss.com/es5-shim/4.5.9/es5-shim.js"></script>
  <script src="//cdn.bootcss.com/rem/1.3.4/js/rem.min.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <script src="http://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
  <script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
  <script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
  <script src="http://cdn.bootcss.com/es6-promise/3.2.2/es6-promise.min.js"></script>
  <script>
    var vm = avalon.define({
      $id: 'vm',
      name: 'hello 33333'
    })
  </script>

</head>
<body>
<div ms-controller="vm">{{@name}}</div>
</body>
</html>
@minwe minwe closed this in 44d6877 Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment