mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Flag accidental mutations in tests
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
iD.Entity = function(a, b) {
|
||||
if (!(this instanceof iD.Entity)) return new iD.Entity(a, b);
|
||||
|
||||
_.extend(this, a, b);
|
||||
_.extend(this, {tags: {}}, a, b);
|
||||
|
||||
if (b) {
|
||||
this.modified = true;
|
||||
}
|
||||
|
||||
if (iD.debug) {
|
||||
Object.freeze(this);
|
||||
Object.freeze(this.tags);
|
||||
}
|
||||
};
|
||||
|
||||
iD.Entity.prototype = {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
iD.Graph = function(entities, annotation) {
|
||||
if (!(this instanceof iD.Graph)) return new iD.Graph(entities, annotation);
|
||||
|
||||
this.entities = entities || {};
|
||||
this.annotation = annotation;
|
||||
|
||||
for (var id in this.entities) {
|
||||
// TODO: update extents that need it.
|
||||
if (this.entities[id].type === 'way' && !this.entities[id]._extent) {
|
||||
@@ -16,7 +19,11 @@ iD.Graph = function(entities, annotation) {
|
||||
this.entities[id]._extent = extent;
|
||||
}
|
||||
}
|
||||
this.annotation = annotation;
|
||||
|
||||
if (iD.debug) {
|
||||
Object.freeze(this);
|
||||
Object.freeze(this.entities);
|
||||
}
|
||||
};
|
||||
|
||||
iD.Graph.prototype = {
|
||||
|
||||
@@ -53,6 +53,10 @@
|
||||
<script type="text/javascript" src="spec/XML.js"></script>
|
||||
<script type="text/javascript" src="spec/Inspector.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
iD.debug = true;
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
|
||||
Reference in New Issue
Block a user