Skip to content

Do not use reserved words as variable names in examples #147

@kosz

Description

@kosz

Maybe you know about this. I've added 'use strict' to the example code and tried to run it

'use strict';
var static = require('node-static');

var fileServer = new static.Server('./public');

require('http').createServer(function (request, response) {
    request.addListener('end', function () {
        fileServer.serve(request, response);
    }).resume();
}).listen(8080);

Error :

  var static = require('node-static');
      ^^^^^^
SyntaxError: Unexpected strict mode reserved word
    at Module._compile (module.js:439:25)

Could confuse the hell out of some people.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions