Skip to content

Commit

Permalink
[js] When slurpy_array is not defined used a special bootstraping arr…
Browse files Browse the repository at this point in the history
…ay type.
  • Loading branch information
pmurias committed Nov 27, 2016
1 parent 41d50d5 commit 10daa77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm/js/nqp-runtime/bootstrap.js
Expand Up @@ -238,3 +238,5 @@ function bootType(typeName, reprName) {
module.exports.bootType = bootType;

module.exports.core = core;

exports.BOOTArray = bootType("BOOTArray", "VMArray");
2 changes: 2 additions & 0 deletions src/vm/js/nqp-runtime/hll.js
Expand Up @@ -4,6 +4,7 @@ var CodeRef = require('./code-ref.js');
var NQPArray = require('./array.js');
var NQPInt = require('./nqp-int.js');
var Null = require('./null.js');
var bootstrap = require('./bootstrap.js');

var op = {};
exports.op = op;
Expand Down Expand Up @@ -117,6 +118,7 @@ op.settypehllrole = function(type, role) {

exports.slurpyArray = function(hllName, array) {
var slurpyArray = hllConfigs[hllName].get('slurpy_array');
if (slurpyArray === undefined) slurpyArray = bootstrap.BOOTArray;
return slurpyArray._STable.REPR.allocateFromArray(slurpyArray._STable, array);
};

0 comments on commit 10daa77

Please sign in to comment.