commit
message
Correcting dependencies issue.
author
Ben Vogt <[email protected]>
date
2016-12-30 22:36:34
stats
2 file(s) changed,
5 insertions(+),
5 deletions(-)
files
src/Main.ts
src/Sheet.ts
1diff --git a/src/Main.ts b/src/Main.ts
2index f364852..76d91c0 100644
3--- a/src/Main.ts
4+++ b/src/Main.ts
5@@ -2,4 +2,4 @@ import { Sheet } from "./Sheet"
6
7 var sheet = new Sheet();
8 sheet.load();
9-sheet.toString();
10\ No newline at end of file
11+sheet.toString();
12diff --git a/src/Sheet.ts b/src/Sheet.ts
13index dd218e9..7c3bbce 100644
14--- a/src/Sheet.ts
15+++ b/src/Sheet.ts
16@@ -99,11 +99,11 @@ var Sheet = (function () {
17 allDependencies.push(refId);
18
19 var item = this.getItem(new A1CellKey(refId));
20- if (item.deps.length) {
21+ if (item.dependencies.length) {
22 getTotalDependencies(refId);
23 }
24 }
25- });
26+ }.bind(this));
27 }
28 }.bind(this);
29 getTotalDependencies(id);
30@@ -451,8 +451,8 @@ var Sheet = (function () {
31 // instance.matrix.updateCellItem(new A1CellKey(origin), {deps: [cell]});
32 instance.matrix.getItem(new A1CellKey(origin)).updateDependencies([cell]);
33 // check references error
34- if (item && item.deps) {
35- if (item.deps.indexOf(cell) !== -1) {
36+ if (item && item.dependencies) {
37+ if (item.dependencies.indexOf(cell) !== -1) {
38 throw Error('REF');
39 }
40 }