Convert all source files to JavaScript

This commit is contained in:
Kevin Sawicki 2016-01-11 18:40:23 -08:00
parent 403870a27e
commit 1f9691ae13
144 changed files with 11211 additions and 7301 deletions

View file

@ -1,29 +0,0 @@
### Do not expose the internal modules to `require`. ###
exports.hideInternalModules = ->
{globalPaths} = require 'module'
if globalPaths.length is 3
### Remove the "common/api/lib" and "browser-or-renderer/api/lib". ###
globalPaths.splice 0, 2
### Attaches properties to |exports|. ###
exports.defineProperties = (exports) ->
Object.defineProperties exports,
### Common modules, please sort with alphabet order. ###
clipboard:
### Must be enumerable, otherwise it woulde be invisible to remote module. ###
enumerable: true
get: -> require '../clipboard'
crashReporter:
enumerable: true
get: -> require '../crash-reporter'
nativeImage:
enumerable: true
get: -> require '../native-image'
shell:
enumerable: true
get: -> require '../shell'
### The internal modules, invisible unless you know their names. ###
CallbacksRegistry:
get: -> require '../callbacks-registry'
deprecate:
get: -> require '../deprecate'

View file

@ -0,0 +1,59 @@
/* Do not expose the internal modules to `require`. */
exports.hideInternalModules = function() {
var globalPaths;
globalPaths = require('module').globalPaths;
if (globalPaths.length === 3) {
/* Remove the "common/api/lib" and "browser-or-renderer/api/lib". */
return globalPaths.splice(0, 2);
}
};
/* Attaches properties to |exports|. */
exports.defineProperties = function(exports) {
return Object.defineProperties(exports, {
/* Common modules, please sort with alphabet order. */
clipboard: {
/* Must be enumerable, otherwise it woulde be invisible to remote module. */
enumerable: true,
get: function() {
return require('../clipboard');
}
},
crashReporter: {
enumerable: true,
get: function() {
return require('../crash-reporter');
}
},
nativeImage: {
enumerable: true,
get: function() {
return require('../native-image');
}
},
shell: {
enumerable: true,
get: function() {
return require('../shell');
}
},
/* The internal modules, invisible unless you know their names. */
CallbacksRegistry: {
get: function() {
return require('../callbacks-registry');
}
},
deprecate: {
get: function() {
return require('../deprecate');
}
}
});
};