Giter Club home page Giter Club logo

compat-table's Introduction

ECMAScript 5/6/7/non-standard compatibility tables

Gitter

Bitdeli Badge

Editing the tests

Edit the data-es5.js, data-es6.js, data-es7.js, or data-non-standard.js files to adjust the tests and their recorded browser results. Run node build.js to build the HTML files from these JavaScript sources.

The ES6 tests themselves should be written in pure ES3, except for the sole ES6 feature being tested (as well as any ES5 features strictly required to use the ES6 feature). The test code is placed in multi-line comments (as in this hack), so that Node/io.js can parse the data scripts without throwing syntax errors when encountering features it does not support. The build.js script will wrap the code in an eval call inside a try, so the tests themselves do not need to catch errors that non-supporting platforms may throw.

The ES6 tests have a significance rating, which affects how a platform's total support percentage is calculated. A test rated "large" (representing a landmark, transformative feature) is worth 1, one rated "medium" (representing a significant feature that's less universally useful, or is primarily connected to another feature) is worth 0.5, and one rated "small" (representing a useful but subtle improvement from ES5) is worth 0.25.

In order to test compilers

Run npm install to install the compilers under test (and remember to npm update them frequently). Then run node build.js compilers to create compiler test pages under es6/compilers. Currently only the ES6 tests produce compiler test pages. Open the compilers' HTML files in a browser with close to zero native ES6 support, such as Internet Explorer 9 (although its lack of support for strict mode will cause some tests to fail), Opera 12, or Safari 5.1 (bearing in mind their native support for TypedArrays, __proto__ and such).

Note that some tests cannot be compiled correctly, as they rely on runtime eval() results to ensure that, for instance, certain syntactic constructs are syntax errors. These will fail on the compiler test pages. Support for those features should be divined manually.

compat-table's People

Contributors

apaprocki avatar arv avatar brianblakely avatar chicoxyzzy avatar cpeterso avatar domenic avatar evilpie avatar fbender avatar johnjbarton avatar kangax avatar keithamus avatar ljharb avatar mathiasbynens avatar paulmillr avatar pepkin88 avatar rvagg avatar rwaldron avatar sebmck avatar skalman avatar syoichi avatar teppeis avatar topaxi avatar toshok avatar tschneidereit avatar ultcombo avatar victor-homyakov avatar webbedspace avatar yaffle avatar ziyunfei avatar zloirock 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.