1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 11:04:00 +03:00

Simplify the Diff constructor.

This commit is contained in:
Rob Rix 2015-10-23 18:56:07 -04:00
parent ccc57c6411
commit 00234c1365

View File

@ -162,14 +162,9 @@
} }
} }
function Diff(json) { function Diff(object) {
if (json.pure != null) { if (object.pure != null) { this.pure = object.pure; }
this.pure = new Patch(json.pure); if (object.roll != null) { this.roll = object.roll; }
}
if (json.roll != null) {
this.ranges = json.roll.extract;
this.roll = new Syntax(json.roll.unwrap, function(x) { return new Diff(x); });
}
return this; return this;
} }
</script> </script>