`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
contain all EcmaScript 5 methods that can be faithfully emulated with a
legacy JavaScript engine.
`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
closely as possible. For these methods, as closely as possible to ES5
is not very close. Many of these shams are intended only to allow code
to be written to ES5 without causing run-time errors in older engines.
In many cases, this means that these shams cause many ES5 methods to
silently fail. Decide carefully whether this is what you want.
## Tests
The tests are written with the Jasmine BDD test framework.
To run the tests, navigate to <root-folder>/tests/.
In order to run against the shim-code, the tests attempt to kill the current
implementation of the missing methods. This happens in <root-folder>/tests/helpers/h-kill.js.
So in order to run the tests against the built-in methods, invalidate that file somehow
(comment-out, delete the file, delete the script-tag, etc.).
## Shims
### Complete tests ###
* Array.prototype.every
* Array.prototype.filter
* Array.prototype.forEach
* Array.prototype.indexOf
* Array.prototype.lastIndexOf
* Array.prototype.map
* Array.prototype.some
* Array.prototype.reduce
* Array.prototype.reduceRight
* Array.isArray
* Date.now
* Date.prototype.toJSON
* Function.prototype.bind
* /!\ Caveat: the bound function's length is always 0.
* /!\ Caveat: the bound function has a prototype property.
* /!\ Caveat: bound functions do not try too hard to keep you
from manipulating their ``arguments`` and ``caller`` properties.
* /!\ Caveat: bound functions don't have checks in ``call`` and
``apply`` to avoid executing as a constructor.
* Object.keys
* String.prototype.trim
### Untested ###
* Date.parse (for ISO parsing)
* Date.prototype.toISOString
## Shams
* /?\ Object.create
For the case of simply "begetting" an object that
inherits prototypically from another, this should work
fine across legacy engines.
/!\ Object.create(null) will work only in browsers that
support prototype assignment. This creates an object
that does not have any properties inherited from
Object.prototype. It will silently fail otherwise.
/!\ The second argument is passed to
Object.defineProperties which will probably fail
silently.
* /?\ Object.getPrototypeOf
This will return "undefined" in some cases. It uses
__proto__ if it's available. Failing that, it uses
constructor.prototype, which depends on the constructor
property of the object's prototype having not been
replaced. If your object was created like this, it
won't work:
function Foo() {
}
Foo.prototype = {};
Because the prototype reassignment destroys the
constructor property.
This will work for all objects that were created using
`Object.create` implemented with this library.
* /!\ Object.getOwnPropertyNames
This method uses Object.keys, so it will not be accurate
on legacy engines.
* Object.isSealed
Returns "false" in all legacy engines for all objects,
which is conveniently guaranteed to be accurate.
* Object.isFrozen
Returns "false" in all legacy engines for all objects,
which is conveniently guaranteed to be accurate.
* Object.isExtensible
Works like a charm, by trying very hard to extend the
object then redacting the extension.
### Fail silently
* /!\ Object.getOwnPropertyDescriptor
The behavior of this shim does not conform to ES5. It
should probably not be used at this time, until its
behavior has been reviewed and been confirmed to be
useful in legacy engines.
* /!\ Object.defineProperty
This method will silently fail to set "writable",
"enumerable", and "configurable" properties.
Providing a getter or setter with "get" or "set" on a
descriptor will silently fail on engines that lack
"__defineGetter__" and "__defineSetter__", which include
all versions of IE up to version 8 so far.
IE 8 provides a version of this method but it only works
on DOM objects. Thus, the shim will not get installed
and attempts to set "value" properties will fail
silently on non-DOM objects.
https://github.com/kriskowal/es5-shim/issues#issue/5
* /!\ Object.defineProperties
This uses the Object.defineProperty shim
* Object.seal
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.freeze
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.preventExtensions
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
eclipse中导入activiti-exceplorer项目 (519个子文件)
access_log.2017-10-11 6KB
access_log.2017-10-12 32KB
access_log.2017-10-13 41KB
ui.properties.alfresco 141B
ui.properties.alfresco 141B
CHANGES 3KB
DemoDataConfiguration.class 12KB
ActivitiEngineConfiguration.class 7KB
DemoDataConfiguration$1.class 5KB
DispatcherServletConfiguration.class 4KB
WebConfigurer.class 4KB
JsonpCallbackFilter.class 3KB
GenericResponseWrapper.class 2KB
FilterServletOutputStream.class 1KB
ApplicationConfiguration.class 1008B
JacksonConfiguration.class 752B
.classpath 1KB
org.eclipse.wst.common.component 694B
org.eclipse.wst.jsdt.ui.superType.container 49B
bootstrap.css 118KB
bootstrap.min.css 98KB
style-common.css 25KB
styles.css 21KB
bootstrap-theme.css 15KB
bootstrap-theme.min.css 13KB
style-editor.css 10KB
style.css 8KB
ng-grid-2.0.7.min.css 7KB
daterangepicker-bs3.css 5KB
editor.css 3KB
style.css 2KB
jasmine.css 2KB
styles.css 788B
styles.css 747B
allmobile.css 197B
lt7.css 181B
android.css 46B
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
activiti-admin-webfont.eot 5KB
loading.gif 17KB
ico-8.gif 2KB
bg-nav-hover.gif 2KB
bg-input-l-1.gif 960B
button-bg-right.gif 925B
nw-handle-dark.gif 839B
se-handle-dark.gif 838B
button-bg-right-active.gif 813B
button-bg-right-down.gif 813B
blank.gif 807B
bg-submit.gif 793B
button-bg-small-right.gif 624B
alfresco.gif 568B
button-bg-small-right-focus.gif 497B
bg-input-r-1.gif 396B
button-bg-left.gif 327B
button-bg-small-left.gif 319B
separator-1.gif 275B
bg-header.gif 272B
bg-number.gif 241B
button-bg-left-down.gif 223B
button-bg-left-active.gif 221B
button-bg-small-left-focus.gif 214B
bg-c.gif 189B
bg-toolbar.gif 158B
bg-number-active.gif 130B
bullet-1.gif 101B
bg-scroll-b-1.gif 99B
bg-scroll-t.gif 99B
bullet-2.gif 99B
bg-scroll-b.gif 99B
bg-scroll-t-1.gif 96B
bg-sidebar.gif 91B
bg-input-c-1.gif 67B
bg-scroll.gif 50B
clear.cache.gif 43B
.gitignore 23B
7DCE794BC875B2EB158C471AAE605A9C.cache.html 1.11MB
51F0F75F652C07C3D4A94041764E0BDF.cache.html 1.09MB
B30394F53E23EE027289EEE987984B57.cache.html 1.09MB
EF39561F1C79BACDED6EFD7217A4D4E3.cache.html 1.09MB
BAA63810C9D1D3E7DD6472EDBD8A2016.cache.html 1.09MB
7FC8F9BA1880B9FD4242AAA23BDE00EC.cache.html 1.09MB
hosted.html 11KB
event-listeners-popup.html 10KB
form-properties-popup.html 9KB
modeler.html 8KB
execution-listeners-popup.html 8KB
editor.html 8KB
task-listeners-popup.html 7KB
index.html 5KB
fields-popup.html 4KB
out-parameters-popup.html 3KB
in-parameters-popup.html 3KB
signal-definitions-popup.html 3KB
assignment-popup.html 3KB
message-definitions-popup.html 2KB
subprocess-reference-popup.html 2KB
sequenceflow-order-popup.html 2KB
save-model.html 2KB
共 519 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
gjm_you
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功