Giter VIP home page Giter VIP logo

ddr-ecma5's Introduction

ddr-ecma5

ddr-ecma5 lets you to write ECMAScript 5 code and run it on older environments like IE6 (I know - it must die anyway) or Firefox < 4. It works also perfectly outside the browser

  • like Rhino, SpiderMonkey, etc.

Installation

  1. In browser applications just add the library to your web page and enjoy

    <script type="text/javascript" src="ddr-ecma5.js"></script>
  2. In Rhino/SpiderMonkey environments use load function:

    load('ddr-ecma5.js');
  3. Node.JS - do not bother to load the library to your node projects - V8 supports ECMAScript 5 by itself.

Testing

If you are curious which functionality of ECMAScript 5 is currently supported by your browser open test/ddr-ecma5-features-test.html file. Another test file - ddr-ecma5-test.html - executes a test of the library itself. All tests are using QUnit framework.

Is it stable?

Yes it is! The library development started at the beginning of 2010 and each feature of it has been properly tested. Version 1.2 of the library contains all ECMAScript 5 methods which can be implemented with ECMAScript 3 features - means no new methods will be added.
Currently the author focuses only on the stability and performance of the library. ddr-ecma5 is used by many developers in their private and commercial projects.

Functionality and compatibility

Not all features of ECMAScript 5 can be implemented with ECMAScript 3. An example can be freeze feature or the strict mode. However most of extensions, like new methods of Array, String or Function are provided by the library.

The table below illustrates in which version of a browser the particular feature of ECMAScript 5 has been introduced. As you can see in most of the cases only the latest versions of the browsers (like IE9, FF4, SF5) are supporting the ECMAScript 5 standard. You can use ddr-ecma5 library to keep the backward compatibility with older browsers without resigning from ECMAScript 5 features.

Feature ddr-ecma5ChromeFirefoxSafariOperaIERhino
Function.prototype.bind 1.07.04.0--9.01.7R3
Object.keys 1.05.04.05.0-9.01.7R3
Object.getPrototypeOf 1.0 15.04.05.0-9.01.7R3
Object.create 1.0 15.04.05.0-9.01.7R3
Object.defineProperty 1.2 15.04.05.0-8.0 31.7R3
Object.defineProperties 1.2 15.04.05.0-9.01.7R3
Object.getOwnPropertyDescriptor 1.25.04.05.0-8.01.7R3
Object.getOwnPropertyNames 1.25.04.05.0-9.01.7R3
Object.preventExtensions - 26.04.0--9.01.7R3
Object.seal - 26.04.0--9.01.7R3
Object.freeze - 26.04.0--9.01.7R3
Object.isExtensible 1.16.04.0--9.01.7R3
Object.isSealed 1.16.04.0--9.01.7R3
Object.isFrozen 1.16.04.0--9.01.7R3
String.prototype.trim 1.05.03.55.010.59.01.7R3
Array.isArray 1.0.15.04.05.010.59.01.7R3
Array.prototype.indexOf 1.05.03.03.210.19.01.6R3
Array.prototype.lastIndexOf 1.05.03.03.210.19.01.6R3
Array.prototype.every 1.05.03.03.210.19.01.6R3
Array.prototype.some 1.05.03.03.210.19.01.6R3
Array.prototype.forEach 1.05.03.03.210.19.01.6R3
Array.prototype.map 1.05.03.03.210.19.01.6R3
Array.prototype.filter 1.05.03.03.210.19.01.6R3
Array.prototype.reduce 1.05.03.04.010.59.01.7R3
Array.prototype.reduceRight 1.05.03.04.010.59.01.7R3
Date.prototype.toISOString 1.05.03.54.010.59.01.7R3
Date.prototype.toJSON 1.05.03.54.0?8.01.7R3
Date.now 1.05.03.04.010.59.01.6R1
Strict mode - 2-4.0----

Notes
1 - limited functionality in comparison to ECMAScript 5 specification
2 - impossible to implement this feature with ECMAScript 3 functionality
3 - on IE8 Object.defineProperty works only with DOM objects.

ddr-ecma5's People

Contributors

ddrcode avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.