Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixes for bnoordhuis
  • Loading branch information
vkurchatkin committed Mar 25, 2015
commit 461d77e3a6b9c7006c239c0963d4dcf7d842763e
2 changes: 0 additions & 2 deletions lib/internal/freelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ exports.FreeList = function(name, max, constructor) {


exports.FreeList.prototype.alloc = function() {
//debug("alloc " + this.name + " " + this.list.length);
return this.list.length ? this.list.shift() :
this.constructor.apply(this, arguments);
};


exports.FreeList.prototype.free = function(obj) {
//debug("free " + this.name + " " + this.list.length);
if (this.list.length < this.max) {
this.list.push(obj);
return true;
Expand Down
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'lib/vm.js',
'lib/zlib.js',

'lib/internal/freelist.js'
'lib/internal/freelist.js',
],
},

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions test/parallel/test-internal-modules-expose.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Flags: --expose_internals

var common = require('../common');
var assert = require('assert');

assert.equal(typeof require('internal/freelist').FreeList, 'function');
2 changes: 1 addition & 1 deletion test/parallel/test-internal-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ assert.throws(function() {
require('internal/freelist');
});

assert(require('../fixtures/internal-modules') === true);
assert(require('../fixtures/internal-modules') === 42);
19 changes: 15 additions & 4 deletions tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,28 @@ def JS2C(source, target):
lines = ExpandMacros(lines, macros)
lines = CompressScript(lines, do_jsmin)
data = ToCArray(s, lines)
id = '/'.join((str(s).split(os.sep)[1:])).split('.')[0]
id = '/'.join(re.split('/|\\\\', s)[1:]).split('.')[0]
if delay: id = id[:-6]
if delay:
delay_ids.append((id, len(lines)))
else:
ids.append((id, len(lines)))

escaped_id = id.replace('/', '$')
source_lines.append(SOURCE_DECLARATION % { 'id': id, 'escaped_id': escaped_id, 'data': data })
source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'escaped_id': escaped_id, 'data': 0 })
native_lines.append(NATIVE_DECLARATION % { 'id': id, 'escaped_id': escaped_id })
source_lines.append(SOURCE_DECLARATION % {
'id': id,
'escaped_id': escaped_id,
'data': data
})
source_lines_empty.append(SOURCE_DECLARATION % {
'id': id,
'escaped_id': escaped_id,
'data': 0
})
native_lines.append(NATIVE_DECLARATION % {
'id': id,
'escaped_id': escaped_id
})

# Build delay support functions
get_index_cases = [ ]
Expand Down