The members of 'Registry' are read-only
65 this.view = new PaperView("c", this);
66
67 this.__grid = new AdaptiveGrid(this);
68 Registry.currentGrid = this.__grid; 69
70 this.tools = {};
71 this.rightMouseTool = new SelectTool();
The members of 'Registry' are read-only
785 this.updateGrid();
786 this.updateDevice(Registry.currentDevice);
787 this.refresh(true);
788 Registry.currentLayer = Registry.currentDevice.layers[0]; 789 this.layerToolBar.setActiveLayer("0");
790 Registry.viewManager.updateActiveLayer();
791 }
The members of 'Registry' are read-only
773 //Common Code for rendering stuff
774 // console.log("Feature Layers", Registry.currentDevice.layers);
775 Registry.currentLayer = Registry.currentDevice.layers[0];
776 Registry.currentTextLayer = Registry.currentDevice.textLayers[0]; 777
778 //TODO: Need to replace the need for this function, right now without this, the active layer system gets broken
779 Registry.viewManager.addDevice(Registry.currentDevice);
The members of 'Registry' are read-only
772 }
773 //Common Code for rendering stuff
774 // console.log("Feature Layers", Registry.currentDevice.layers);
775 Registry.currentLayer = Registry.currentDevice.layers[0]; 776 Registry.currentTextLayer = Registry.currentDevice.textLayers[0];
777
778 //TODO: Need to replace the need for this function, right now without this, the active layer system gets broken
The members of 'Registry' are read-only
763 case 1.2:
764 this.loadCustomComponents(json);
765 device = Device.fromInterchangeV1_2(json);
766 Registry.currentDevice = device; 767 this.__currentDevice = device;
768 break;
769 default:
The members of 'Registry' are read-only
757 case 1.1:
758 this.loadCustomComponents(json);
759 device = Device.fromInterchangeV1_1(json);
760 Registry.currentDevice = device; 761 this.__currentDevice = device;
762 break;
763 case 1.2:
The members of 'Registry' are read-only
751 case 1:
752 this.loadCustomComponents(json);
753 device = Device.fromInterchangeV1(json);
754 Registry.currentDevice = device; 755 this.__currentDevice = device;
756 break;
757 case 1.1:
The members of 'Registry' are read-only
743 if (null === version || undefined === version) {
744 console.log("Loading Legacy Format...");
745 device = Device.fromJSON(json);
746 Registry.currentDevice = device; 747 this.__currentDevice = device;
748 } else {
749 console.log("Version Number: " + version);
The members of 'Registry' are read-only
177
178 this.__generateUI();
179
180 Registry.currentLayer = Registry.currentDevice.layers[0];181 this.setActiveLayer("0");
182 Registry.viewManager.updateActiveLayer();
183 }
The members of 'Registry' are read-only
56 for (let i = 0; i < controlButtons.length; i++) {
57 let controlButton = controlButtons[i];
58 controlButton.onclick = function(event) {
59 Registry.currentLayer = Registry.currentDevice.layers[controlButton.dataset.layerindex]; 60 ref.setActiveLayer(controlButton.dataset.layerindex);
61 Registry.viewManager.updateActiveLayer();
62 };
The members of 'Registry' are read-only
47 for (let i = 0; i < flowButtons.length; i++) {
48 let flowButton = flowButtons[i];
49 flowButton.onclick = function(event) {
50 Registry.currentLayer = Registry.currentDevice.layers[flowButton.dataset.layerindex]; 51 ref.setActiveLayer(flowButton.dataset.layerindex);
52 Registry.viewManager.updateActiveLayer();
53 };
The members of 'Registry' are read-only
17 let ref = this;
18 this.__acceptTextButton.onclick = function() {
19 Registry.viewManager.activateTool("InsertTextTool");
20 Registry.text = document.getElementById("inserttext_textinput").value;21 ref.__dialog.close();
22 };
23
The members of 'THREE' are read-only
8 * @author mrdoob / http://mrdoob.com/
9
10 */
11THREE.STLExporter = function() {}; 12
13THREE.STLExporter.prototype = {
14 constructor: THREE.STLExporter,
The members of 'Registry' are read-only
559 if (null === version || undefined === version) {
560 console.log("Loading Legacy Format...");
561 device = Device.fromJSON(json);
562 Registry.currentDevice = device;563 this.__currentDevice = device;
564 } else {
565 console.log("Version Number: " + version);
The members of 'Registry' are read-only
585 this.updateGrid();
586 this.updateDevice(Registry.currentDevice);
587 this.refresh(true);
588 Registry.currentLayer = Registry.currentDevice.layers[0];589 // this.layerToolBar.setActiveLayer("0");
590 Registry.viewManager.updateActiveLayer();
591 }
The members of 'Registry' are read-only
576 }
577 //Common Code for rendering stuff
578 Registry.currentLayer = Registry.currentDevice.layers[0];
579 Registry.currentTextLayer = Registry.currentDevice.textLa;580
581 //TODO: Need to replace the need for this function, right now without this, the active layer system gets broken
582 Registry.viewManager.addDevice(Registry.currentDevice);
The members of 'Registry' are read-only
575 }
576 }
577 //Common Code for rendering stuff
578 Registry.currentLayer = Registry.currentDevice.layers[0];579 Registry.currentTextLayer = Registry.currentDevice.textLa;
580
581 //TODO: Need to replace the need for this function, right now without this, the active layer system gets broken
The members of 'Registry' are read-only
566 switch (version) {
567 case 1:
568 device = Device.fromInterchangeV1(json);
569 Registry.currentDevice = device;570 this.__currentDevice = device;
571
572 break;
The members of 'Registry' are read-only
25 this.view = new PaperView("c", this);
26
27 this.__grid = new AdaptiveGrid(this);
28 Registry.currentGrid = this.__grid; 29
30 // this.tools = {};
31 // this.rightMouseTool = new SelectTool();
The members of 'Registry' are read-only
20 let set = sets[key];
21
22 let newSet = new FeatureSet(set.definitions, set.tools, set.render2D, set.render3D, name);
23 Registry.featureSet = newSet;24 registeredFeatureSets[key] = newSet;
25 Registry.featureDefaults[key] = newSet.getDefaults();
26 }
The members of 'Registry' are read-only
56 viewManager = TrackJS.watchAll(viewManager);
57 }
58
59 Registry.viewManager = viewManager; 60
61 viewManager.loadDeviceFromJSON(JSON.parse(Examples.example2));
62 viewManager.updateGrid();
Description
The updates (assignments, increments and decrements) of imported bindings by ES Modules cause runtime errors.
The standard import looks something like import something from 'somewhere/else';
.
But what if the module you are importing isn’t actually exporting anything and only used to run code?
As you move into modules, you will find at first side-effects are going to happen.
The import statement isn't a pass-by-value situation.
You will get a binding to the original source.
Bad Practice
import mod, { named } from "./mod.mjs"
import * as mod_ns from "./mod.mjs"
mod++ // ERROR: 'mod' is readonly.
named++ // ERROR: 'named' is readonly.
mod_ns.named = 3 // ERROR: the members of 'mod_ns' is readonly.
mod_ns = {} // ERROR: 'mod_ns' is readonly.
Recommended
import mod, { named } from "./mod.mjs"
import * as mod_ns from "./mod.mjs"
mod.prop = 1
named.prop = 2
mod_ns.named.prop = 3
// Known Limitation
function test(obj) {
obj.named = 4 // Not errored because 'obj' is not namespace objects.
}
test(mod_ns) // Not errored because it doesn't know that 'test' updates the member of the argument.