Giter Club home page Giter Club logo

js2-mode's Introduction

js2-mode

An improved JavaScript mode for GNU Emacs. Forked from http://code.google.com/p/js2-mode/.

Install

$ git clone git://github.com/mooz/js2-mode.git
$ cd js2-mode
$ emacs --batch --eval '(byte-compile-file "js2-mode.el")'

Then, place js2-mode.elc into your site-lisp directory.

In you emacs config:

(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))

See http://code.google.com/p/js2-mode/wiki/InstallationInstructions for details.

Differences between original js2-mode.el

Support for abbreviated destructuring assignments

let {a, b}       = {a: 10, b: 20}; // Abbreviated   (Not supported in original js2-mode.el)
let {a: a, b: b} = {a: 10, b: 20}; // Same as above (Supported in original js2-mode.el)

(function ({responseText}) { /* */ })(xhr); // As the argument of function

Support for expression closure in property value

let worker = {
    get age() 20,
    get sex() "male",
    fire: function () _fire()
};

Fixed the odd indentation of "else if" with no braces

In original js2-mode.el,

if (foo)
    return foo;
else if (bar)
return bar;      // here

In this js2-mode.el,

if (foo)
    return foo;
else if (bar)
    return bar;  // fixed

Bugs

If you find problems, please report them to http://github.com/mooz/js2-mode/issues.

js2-mode's People

Contributors

mooz avatar

Stargazers

none-p avatar

Watchers

none-p avatar James Cloos 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.