aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.js')
-rw-r--r--src/compiler.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler.js b/src/compiler.js
index c39927e7..89da32d5 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -29,11 +29,14 @@ if (ENVIRONMENT_IS_NODE) {
};
var nodeFS = require('fs');
+ var nodePath = require('path');
read = function(filename) {
+ filename = nodePath['normalize'](filename);
var ret = nodeFS['readFileSync'](filename).toString();
- if (!ret && filename[0] != '/') {
- filename = __dirname.split('/').slice(0, -1).join('/') + '/src/' + filename;
+ // The path is absolute if the normalized version is the same as the resolved.
+ if (!ret && filename != nodePath['resolve'](filename)) {
+ filename = path.join(__dirname, '..', 'src', filename);
ret = nodeFS['readFileSync'](filename).toString();
}
return ret;
@@ -111,6 +114,7 @@ load('settings.js');
var settings_file = arguments_[0];
var ll_file = arguments_[1];
+additionalLibraries = Array.prototype.slice.call(arguments_, 2);
if (settings_file) {
var settings = JSON.parse(read(settings_file));
@@ -119,6 +123,7 @@ if (settings_file) {
}
}
+
if (CORRECT_SIGNS >= 2) {
CORRECT_SIGNS_LINES = set(CORRECT_SIGNS_LINES); // for fast checking
}
@@ -141,6 +146,8 @@ if (PGO) { // by default, correct everything during PGO
EXPORTED_FUNCTIONS = set(EXPORTED_FUNCTIONS);
EXPORTED_GLOBALS = set(EXPORTED_GLOBALS);
+RUNTIME_DEBUG = LIBRARY_DEBUG || GL_DEBUG;
+
// Settings sanity checks
assert(!(USE_TYPED_ARRAYS === 2 && QUANTUM_SIZE !== 4), 'For USE_TYPED_ARRAYS == 2, must have normal QUANTUM_SIZE of 4');