Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[js] Fix stuff that js-lint complains about. Comply to the google js …
…coding (except allow longer lines).
  • Loading branch information
pmurias committed Oct 4, 2015
1 parent 779dc95 commit c67d5bc
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 25 deletions.
18 changes: 9 additions & 9 deletions src/vm/js/nqp-runtime/core.js
Expand Up @@ -53,14 +53,14 @@ op.isinvokable = function(obj) {

op.escape = function(str) {
return str
.replace(/\\/g, '\\\\')
.replace(/\x1B/g, '\\e')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t')
.replace(/\f/g, '\\f')
.replace(/[\b]/g, '\\b')
.replace(/"/g, '\\"');
.replace(/\\/g, '\\\\')
.replace(/\x1B/g, '\\e')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t')
.replace(/\f/g, '\\f')
.replace(/[\b]/g, '\\b')
.replace(/"/g, '\\"');
};

op.x = function(str, times) {
Expand Down Expand Up @@ -219,7 +219,7 @@ op.setboolspec = function(obj, mode, method) {
return obj;
};

function Capture(named,pos) {
function Capture(named, pos) {
this.pos = pos;
}

Expand Down
9 changes: 3 additions & 6 deletions src/vm/js/nqp-runtime/deserialization.js
Expand Up @@ -454,8 +454,7 @@ BinaryCursor.prototype.deserialize = function(sc) {
var objects_offset = this.I32();
var objects_number = this.I32();
var objects_data = this.I32();
var objects =
this.at(objects_offset).times(objects_number, function(cursor) {
var objects = this.at(objects_offset).times(objects_number, function(cursor) {
return cursor.objectEntry(objects_data);
});

Expand Down Expand Up @@ -504,8 +503,7 @@ BinaryCursor.prototype.deserialize = function(sc) {

var closures_offset = this.I32();
var closures_number = this.I32();
var closures =
this.at(closures_offset).times(closures_number, function(cursor) {
var closures = this.at(closures_offset).times(closures_number, function(cursor) {
return cursor.closureEntry();
});

Expand All @@ -532,8 +530,7 @@ BinaryCursor.prototype.deserialize = function(sc) {
var contexts_offset = this.I32();
var contexts_number = this.I32();
var contexts_data = this.I32();
var contexts =
this.at(contexts_offset).times(contexts_number, function(cursor) {
var contexts = this.at(contexts_offset).times(contexts_number, function(cursor) {
return cursor.contextEntry(contexts_data);
});

Expand Down
2 changes: 1 addition & 1 deletion src/vm/js/nqp-runtime/reprs.js
Expand Up @@ -595,7 +595,7 @@ VMArray.prototype.deserialize_repr_data = function(cursor) {
/* TODO - type */
};

VMArray.prototype.deserialize_array = function(object,data) {
VMArray.prototype.deserialize_array = function(object, data) {
if (this.type !== null) {
console.log('NYI: VMArrays of a type different then null');
}
Expand Down
14 changes: 7 additions & 7 deletions src/vm/js/nqp-runtime/serialization-context.js
Expand Up @@ -5,15 +5,15 @@

/**
* @constructor
* @property handle The handle of this SC.
* @property description Description (probably the file name) if any.
* @property root_objects The root set of objects that live in this SC.
* @property root_stables The root set of STables that live in this SC.
* @property root_codes The root set of code refs that live in this SC.
* @property rep_indexes Repossession info. The following lists have matching indexes, each
* @public handle The handle of this SC.
* @public description Description (probably the file name) if any.
* @public root_objects The root set of objects that live in this SC.
* @public root_stables The root set of STables that live in this SC.
* @public root_codes The root set of code refs that live in this SC.
* @public rep_indexes Repossession info. The following lists have matching indexes, each
* representing the integer of an object in our root set along with the SC
* that the object was originally from.
* @property rep_scs
* @public rep_scs
*/

function SerializationContext(handle) {
Expand Down
3 changes: 1 addition & 2 deletions src/vm/js/nqp-runtime/serialization.js
Expand Up @@ -91,8 +91,7 @@ BinaryWriteCursor.prototype.varint = function(value) {
/* All the other high bits should be the same as the top bit of the
nybble we keep. Or we have a bug. */

console.assert((nybble >> 3) == 0
|| (nybble >> 3) == ~0);
console.assert((nybble >> 3) == 0 || (nybble >> 3) == ~0);

this.I8((rest << 4) | (nybble & 0xF));

Expand Down

0 comments on commit c67d5bc

Please sign in to comment.