Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

unable to create (function() {})(); wrappers in JS #60

Open
ericmoritz opened this issue Jan 21, 2011 · 1 comment
Open

unable to create (function() {})(); wrappers in JS #60

ericmoritz opened this issue Jan 21, 2011 · 1 comment
Labels

Comments

@ericmoritz
Copy link

There's a pattern in Javascript to protect scope by wrapping the code in an anonymous function like so:

var utils = {};
(function() {
    function add(x,y) {
        return x + y;
    }
    // exports
    utils.add = add;
});

Unfortunately when I get as far as:
var utils = {}
;
(function)

Before Emacs reports: Point 29 after end of properties when I attempt to type a ( after the keyword "function"

@ghost
Copy link

ghost commented Mar 5, 2011

commenting out line 10 of starter-kit-js.el ((add-hook 'espresso-mode-hook 'run-coding-hook)) "fixed" the problem for me. I haven't looked deeper into the problem though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant