merge previous bindings constantViolations and path onto new bindings constantViolations

This commit is contained in:
Sebastian McKenzie 2015-06-08 14:49:09 +01:00
parent 7fade101be
commit 2d0355b3b9
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
export default class Binding {
constructor({ identifier, scope, path, kind }) {
constructor({ existing, identifier, scope, path, kind }) {
this.constantViolations = [];
this.constant = true;
@ -12,6 +12,13 @@ export default class Binding {
this.kind = kind;
this.clearValue();
if (existing) {
this.constantViolations = this.constantViolations.concat(
existing.path,
existing.constantViolations
);
}
}
/**

View File

@ -508,6 +508,7 @@ export default class Scope {
this.bindings[name] = new Binding({
identifier: id,
existing: local,
scope: this,
path: path,
kind: kind