|
1 | 1 | module('users.bert.SqueakJS.vm').requires().toRun(function() {
|
| 2 | +"use strict"; |
2 | 3 | /*
|
3 | 4 | * Copyright (c) 2013,2014 Bert Freudenberg
|
4 | 5 | *
|
@@ -559,19 +560,19 @@ Object.extend(Squeak,
|
559 | 560 | var path = this.splitFilePath(dirpath),
|
560 | 561 | localEntries = localStorage["squeak:" + path.fullname],
|
561 | 562 | template = includeTemplates && localStorage["squeak-template:" + path.fullname];
|
562 |
| - if (localEntries || template) { |
563 |
| - var dir = {}; |
564 |
| - function addEntries(entries) { |
565 |
| - for (var key in entries) { |
566 |
| - if (entries.hasOwnProperty(key)) { |
567 |
| - var entry = entries[key]; |
568 |
| - dir[entry[0]] = entry; |
569 |
| - } |
| 563 | + function addEntries(dir, entries) { |
| 564 | + for (var key in entries) { |
| 565 | + if (entries.hasOwnProperty(key)) { |
| 566 | + var entry = entries[key]; |
| 567 | + dir[entry[0]] = entry; |
570 | 568 | }
|
571 | 569 | }
|
| 570 | + } |
| 571 | + if (localEntries || template) { |
572 | 572 | // local entries override templates
|
573 |
| - if (template) addEntries(JSON.parse(template).entries); |
574 |
| - if (localEntries) addEntries(JSON.parse(localEntries)); |
| 573 | + var dir = {}; |
| 574 | + if (template) addEntries(dir, JSON.parse(template).entries); |
| 575 | + if (localEntries) addEntries(dir, JSON.parse(localEntries)); |
575 | 576 | return dir;
|
576 | 577 | }
|
577 | 578 | if (path.fullname == "/") return {};
|
@@ -899,17 +900,17 @@ Object.subclass('Squeak.Image',
|
899 | 900 | return false; // don't do more
|
900 | 901 | }
|
901 | 902 | };
|
| 903 | + function mapSomeObjectsAsync() { |
| 904 | + if (mapSomeObjects()) { |
| 905 | + window.setTimeout(mapSomeObjectsAsync, 0); |
| 906 | + } else { |
| 907 | + if (thenDo) thenDo(); |
| 908 | + } |
| 909 | + }; |
902 | 910 | if (!progressDo) {
|
903 | 911 | while (mapSomeObjects()); // do it synchronously
|
904 | 912 | if (thenDo) thenDo();
|
905 | 913 | } else {
|
906 |
| - function mapSomeObjectsAsync() { |
907 |
| - if (mapSomeObjects()) { |
908 |
| - window.setTimeout(mapSomeObjectsAsync, 0); |
909 |
| - } else { |
910 |
| - if (thenDo) thenDo(); |
911 |
| - } |
912 |
| - }; |
913 | 914 | window.setTimeout(mapSomeObjectsAsync, 0);
|
914 | 915 | }
|
915 | 916 | },
|
|
0 commit comments