"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/coffee-script/lib/coffee-script/register.js" (7 Feb 2017, 1868 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 // Generated by CoffeeScript 1.9.0
    2 (function() {
    3   var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, loadFile, path, _i, _len, _ref;
    4 
    5   CoffeeScript = require('./coffee-script');
    6 
    7   child_process = require('child_process');
    8 
    9   helpers = require('./helpers');
   10 
   11   path = require('path');
   12 
   13   loadFile = function(module, filename) {
   14     var answer;
   15     answer = CoffeeScript._compileFile(filename, false);
   16     return module._compile(answer, filename);
   17   };
   18 
   19   if (require.extensions) {
   20     _ref = CoffeeScript.FILE_EXTENSIONS;
   21     for (_i = 0, _len = _ref.length; _i < _len; _i++) {
   22       ext = _ref[_i];
   23       require.extensions[ext] = loadFile;
   24     }
   25     Module = require('module');
   26     findExtension = function(filename) {
   27       var curExtension, extensions;
   28       extensions = path.basename(filename).split('.');
   29       if (extensions[0] === '') {
   30         extensions.shift();
   31       }
   32       while (extensions.shift()) {
   33         curExtension = '.' + extensions.join('.');
   34         if (Module._extensions[curExtension]) {
   35           return curExtension;
   36         }
   37       }
   38       return '.js';
   39     };
   40     Module.prototype.load = function(filename) {
   41       var extension;
   42       this.filename = filename;
   43       this.paths = Module._nodeModulePaths(path.dirname(filename));
   44       extension = findExtension(filename);
   45       Module._extensions[extension](this, filename);
   46       return this.loaded = true;
   47     };
   48   }
   49 
   50   if (child_process) {
   51     fork = child_process.fork;
   52     binary = require.resolve('../../bin/coffee');
   53     child_process.fork = function(path, args, options) {
   54       if (helpers.isCoffee(path)) {
   55         if (!Array.isArray(args)) {
   56           options = args || {};
   57           args = [];
   58         }
   59         args = [path].concat(args);
   60         path = binary;
   61       }
   62       return fork(path, args, options);
   63     };
   64   }
   65 
   66 }).call(this);