Permalink
Browse files

Separate shims and shams

  • Loading branch information...
1 parent 9f539ab commit 11f9ef990b941240d9145c24c540b8e553ce12f9 @kriskowal kriskowal committed Oct 8, 2012
Showing with 391 additions and 372 deletions.
  1. +4 −0 CHANGES
  2. +25 −0 CONTRIBUTORS.md
  3. +14 −21 README.md
  4. +326 −0 es5-sham.js
  5. +6 −0 es5-sham.min.js
  6. +2 −332 es5-shim.js
  7. +13 −18 es5-shim.min.js
  8. +1 −1 package.json
View
@@ -1,3 +1,7 @@
+
+2.0.0
+ - Separate reliable shims from dubious shims (shams).
+
1.2.10
- Group-effort Style Cleanup
- Took a stab at fixing Object.defineProperty on IE8 without
View
@@ -0,0 +1,25 @@
+
+- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
+- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
+ Project)
+- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
+- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
+- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
+- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
+- kossnocorp Sasha Koss XXX TODO License or CLA
+- bryanforbes Bryan Forbes XXX TODO License or CLA
+- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
+- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
+ License
+- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
+- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
+- iwyg XXX TODO License or CLA
+- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
+- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
+- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
+- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
+- rwldrn Rick Waldron Copyright (C) 2011 MIT License
+- lexer Alexey Zakharov XXX TODO License or CLA
+- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
+ Copyright (C) 2009 MIT License
+
View
@@ -1,19 +1,17 @@
-Provides compatibility shims so that legacy JavaScript
-engines behave as closely as possible to ES5.
-This package requires quite a bit more attention and
-testing. It is not likely to behave as advertised in a
-large cross-section of browsers.
+`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.
-"As closely as possible to ES5" is not very close. Many of
-these shims 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 shims cause many ES5
-methods to silently fail. Decide carefully whether this is
-what you want.
+`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
------
+
+## Tests
The tests are written with the Jasmine BDD test framework.
To run the tests, navigate to <root-folder>/tests/.
@@ -23,8 +21,7 @@ implementation of the missing methods. This happens in <root-folder>/tests/helpe
So in order to run the tests against the build-in methods, invalidate that file somehow
(comment-out, delete the file, delete the script-tag, etc.).
-SAFE SHIMS
-----------
+## Shims
### Complete tests ###
@@ -55,9 +52,7 @@ SAFE SHIMS
* Date.parse (for ISO parsing)
* Date.prototype.toISOString
-
-DUBIOUS SHIMS
--------------
+## Shams
* /?\ Object.create
@@ -113,9 +108,7 @@ DUBIOUS SHIMS
Works like a charm, by trying very hard to extend the
object then redacting the extension.
-
-SHIMS THAT FAIL SILENTLY
-------------------------
+### Fail silently
* /!\ Object.getOwnPropertyDescriptor
Oops, something went wrong.

0 comments on commit 11f9ef9

Please sign in to comment.