@breakside/jskit 2022.7.0 → 2022.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/JS/FNTFontDescriptor.js +9 -6
  5. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  6. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  7. package/Frameworks/Foundation.jsframework/JS/JSHTMLHTTPClient.js +9 -1
  8. package/Frameworks/Foundation.jsframework/JS/JSImage.js +12 -5
  9. package/Frameworks/Foundation.jsframework/JS/JSURLResponse.js +10 -0
  10. package/Frameworks/Foundation.jsframework/JS/JSXMLParser.js +81 -8
  11. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  12. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  13. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  14. package/Info.json +2 -2
  15. package/Node/io.breakside.jskit-bundle.js +2 -2
  16. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  17. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  18. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  19. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  20. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  21. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  22. package/Root/Frameworks/DBKit/DBRedisStore.js +2 -1
  23. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  24. package/Root/Frameworks/DOM/Info.yaml +1 -1
  25. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  26. package/Root/Frameworks/Dispatch/JSHTMLDispatchQueue.js +4 -2
  27. package/Root/Frameworks/FontKit/FNTFontDescriptor.js +9 -6
  28. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  29. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  30. package/Root/Frameworks/Foundation/JSHTMLHTTPClient.js +9 -1
  31. package/Root/Frameworks/Foundation/JSImage.js +12 -5
  32. package/Root/Frameworks/Foundation/JSURLResponse.js +10 -0
  33. package/Root/Frameworks/Foundation/JSXMLParser.js +81 -8
  34. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  35. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  36. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  37. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  38. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  39. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  40. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  41. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  42. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  43. package/Root/Frameworks/ServerKit/SKHTTPServer+Node.js +8 -0
  44. package/Root/Frameworks/ServerKit/SKHTTPServer.js +1 -1
  45. package/Root/Frameworks/ServerKit/SKNodeHTTPRequest.js +3 -0
  46. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  47. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  48. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  49. package/Root/Frameworks/UIKit/UIApplication.js +15 -1
  50. package/Root/Frameworks/UIKit/UICollectionView.js +21 -32
  51. package/Root/Frameworks/UIKit/UIScene.js +5 -1
  52. package/Root/Frameworks/UIKit/UIScrollView.js +15 -12
  53. package/Root/Frameworks/UIKit/UISegmentedControl.js +15 -0
  54. package/Root/Frameworks/UIKit/UITabView.js +5 -6
  55. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  56. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
4
- "JSBundleVersion": "2022.7.0",
4
+ "JSBundleVersion": "2022.11.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "DOM+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
12
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.DOM",
6
- "JSBundleVersion": "2022.7.0",
6
+ "JSBundleVersion": "2022.11.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
11
11
  "node": "DOM+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
14
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
4
- "JSBundleVersion": "2022.7.0",
4
+ "JSBundleVersion": "2022.11.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
8
8
  "html": "FontKit+HTML.js"
9
9
  },
10
10
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
11
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
11
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
12
12
  }
@@ -42,13 +42,16 @@ JSClass("FNTFontDescriptor", JSDataFontDescriptor, {
42
42
  }
43
43
  var os2 = this.font.tables['OS/2'];
44
44
  if (os2){
45
- this._weight = Math.floor(os2.weight / 100) * 100;
46
- this._style = (os2.selection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
45
+ this._weight = Math.floor(os2.usWeightClass / 100) * 100;
46
+ this._style = (os2.fsSelection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
47
+ }
48
+ var name = font.tables.name;
49
+ if (name){
50
+ this._family = name.family;
51
+ this._postScriptName = name.postscript;
52
+ this._face = name.face;
53
+ this._name = name.fullName;
47
54
  }
48
- // this._family
49
- // this._name
50
- // this._face
51
- // this._postScriptName
52
55
  this._characterToGlyphMap = {};
53
56
  this._glyphToCharacterMap = {};
54
57
  },
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.FontKit",
6
- "JSBundleVersion": "2022.7.0",
6
+ "JSBundleVersion": "2022.11.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
10
10
  "html": "FontKit+HTML.js"
11
11
  },
12
12
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
13
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
13
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
14
14
  },
15
15
  "Resources": [],
16
16
  "ResourceLookup": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
4
- "JSBundleVersion": "2022.7.0",
4
+ "JSBundleVersion": "2022.11.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "Foundation+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
12
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
13
13
  }
@@ -38,7 +38,15 @@ JSClass("JSHTMLHTTPClient", JSObject, {
38
38
  }
39
39
  };
40
40
  var failEventHandler = function(e){
41
- complete(new Error(e.type));
41
+ if (e.type == "error"){
42
+ complete(new Error("XMLHttpRequest error (network down, timeout, CORS, etc)"));
43
+ }else if (e.type == "timeout"){
44
+ complete(new Error("XMLHttpRequest timeout"));
45
+ }else if (e.type == "abort"){
46
+ complete(new Error("XMLHttpRequest aborted"));
47
+ }else{
48
+ complete(new Error("XMLHttpRequest failed with event: " + e.type));
49
+ }
42
50
  };
43
51
  try {
44
52
  var response = null;
@@ -417,7 +417,7 @@ _JSDataImage.sizeFromSVGData = function(data){
417
417
  size.width = px(attrs.width);
418
418
  size.height = px(attrs.height);
419
419
  }else if (attrs.viewBox){
420
- var box = attrs.viewBox.split(/\s+/).map(function(n){ parseInt(n); });
420
+ var box = attrs.viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
421
421
  size.width = box[2];
422
422
  size.height = box[3];
423
423
  }
@@ -449,14 +449,21 @@ JSClass("_JSURLImage", JSImage, {
449
449
 
450
450
  getData: function(completion, target){
451
451
  if (!completion){
452
- completion = Promise.completion(Promise.resolveNonNull);
452
+ completion = Promise.completion(Promise.rejectNonNullSecondArgument);
453
453
  }
454
454
  var session = JSURLSession.shared;
455
455
  var task = session.dataTaskWithURL(this.url, function(error){
456
- if (error !== null || task.response.statusClass != JSURLResponse.StatusClass.success){
457
- completion.call(target, null);
456
+ if (error !== null){
457
+ completion.call(target, null, error);
458
+ return;
459
+ }
460
+ try{
461
+ task.response.assertSuccess();
462
+ }catch (e){
463
+ completion.call(target, null, e);
464
+ return;
458
465
  }
459
- completion.call(target, task.response.data);
466
+ completion.call(target, task.response.data, null);
460
467
  });
461
468
  task.resume();
462
469
  return completion.promise;
@@ -163,6 +163,16 @@ JSURLResponse.StatusClass = {
163
163
  serverError: 5
164
164
  };
165
165
 
166
+ JSURLResponse.error = function(statusCode, object){
167
+ var response = JSURLResponse.init();
168
+ response.statusCode = statusCode;
169
+ if (object !== undefined){
170
+ response.data = JSON.stringify(object).utf8();
171
+ response.headerMap.add("Content-Type", response.jsonMime);
172
+ }
173
+ return new JSURLResponseError(response);
174
+ };
175
+
166
176
  JSGlobalObject.JSURLResponseError = function(response){
167
177
  if (this === undefined){
168
178
  return new JSURLResponseError();
@@ -36,6 +36,7 @@ JSClass("JSXMLParser", JSObject, {
36
36
  var c;
37
37
  var lineNumber = 1;
38
38
  var lineOffset;
39
+ var entityMap = JSCopy(defaultEntityMap);
39
40
  var readToken = function(){
40
41
  if (offset >= length){
41
42
  return null;
@@ -131,8 +132,77 @@ JSClass("JSXMLParser", JSObject, {
131
132
  return {kind: 'PI', name: name, value: readUntil('?>')};
132
133
  }
133
134
  if (token == '<!DOCTYPE'){
134
- var parts = readUntil('>').trim().split(' ');
135
- return {kind: 'Doctype', name: parts[0], publicId: parts[1], systemId: parts[2]};
135
+ readWhitespace();
136
+ name = readName();
137
+ readWhitespace();
138
+ var doctype = {kind: 'Doctype', name: name, publicId: null, systemId: null, entities: {}};
139
+ if (offset < length && input[offset] !== '>'){
140
+ if (input[offset] != '['){
141
+ name = readName();
142
+ readWhitespace();
143
+ if (name == "SYSTEM"){
144
+ if (offset < length && (input[offset] == "'" || input[offset] == '"')){
145
+ doctype.systemId = readAttributeValue();
146
+ readWhitespace();
147
+ }else{
148
+ throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
149
+ }
150
+ }else if (name === "PUBLIC"){
151
+ if (offset < length && (input[offset] == "'" || input[offset] == '"')){
152
+ doctype.publicId = readAttributeValue();
153
+ readWhitespace();
154
+ if (offset < length && (input[offset] == "'" || input[offset] == '"')){
155
+ doctype.systemId = readAttributeValue();
156
+ readWhitespace();
157
+ }else{
158
+ throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
159
+ }
160
+ }else{
161
+ throw new Error("Expecting quote at " + lineNumber + ':' + (offset - lineOffset));
162
+ }
163
+ }else{
164
+ throw new Error("Expecting SYSTEM or PUBLIC at " + lineNumber + ':' + (offset - lineOffset));
165
+ }
166
+ }
167
+ if (offset < length && input[offset] == '['){
168
+ ++offset;
169
+ readWhitespace();
170
+ while (offset < length && input[offset] !== ']'){
171
+ token = readToken();
172
+ if (token == '<!'){
173
+ name = readName();
174
+ if (name === "ENTITY"){
175
+ readWhitespace();
176
+ if (offset >= length){
177
+ throw new Error("Expecting ENTITY name at " + lineNumber + ':' + (offset - lineOffset));
178
+ }
179
+ name = readName();
180
+ readWhitespace();
181
+ if (offset >= length){
182
+ throw new Error("Expecting ENTITY value at " + lineNumber + ':' + (offset - lineOffset));
183
+ }
184
+ entityMap[name] = readAttributeValue();
185
+ }
186
+ readUntil('>');
187
+ }else if (token == '<?'){
188
+ readUntil('?>');
189
+ }else if (token == '<!--'){
190
+ readUntil('-->');
191
+ }
192
+ readWhitespace();
193
+ }
194
+ if (offset >= length || input[offset] !== ']'){
195
+ throw new Error("Expecting ] at end of DOCTYPE at " + lineNumber + ':' + (offset - lineOffset));
196
+ }
197
+ ++offset;
198
+ readWhitespace();
199
+ }
200
+ }
201
+ if (offset >= length || input[offset] !== '>'){
202
+ throw new Error("Expecting > at end of DOCTYPE at " + lineNumber + ':' + (offset - lineOffset));
203
+ }
204
+ ++offset;
205
+ return doctype;
136
206
  }
137
207
  if (token == '<![CDATA['){
138
208
  return {kind: 'CDATA', value: readUntil(']]>')};
@@ -154,7 +224,7 @@ JSClass("JSXMLParser", JSObject, {
154
224
  if (offset < length && input[offset] == '='){
155
225
  ++offset;
156
226
  readWhitespace();
157
- attributes.push({name: attrName, value: textByDecodingEntities(readAttributeValue())});
227
+ attributes.push({name: attrName, value: textByDecodingEntities(readAttributeValue(), entityMap)});
158
228
  }else{
159
229
  attributes.push({name: attrName, value: null});
160
230
  }
@@ -189,7 +259,7 @@ JSClass("JSXMLParser", JSObject, {
189
259
  ++offset;
190
260
  return {kind: 'ElementEnd', name: name};
191
261
  }
192
- return {kind: 'Text', value: textByDecodingEntities(token)};
262
+ return {kind: 'Text', value: textByDecodingEntities(token, entityMap)};
193
263
  };
194
264
  var readUntil = function(token){
195
265
  var index = input.indexOf(token, offset);
@@ -267,7 +337,10 @@ JSClass("JSXMLParser", JSObject, {
267
337
  }
268
338
  obj = readObject();
269
339
  var elementNameStack = [];
270
- var namespaces = {':default:': null};
340
+ var namespaces = {
341
+ ':default:': null,
342
+ 'xml': 'http://www.w3.org/XML/1998/namespace'
343
+ };
271
344
  var namespacesStack = [];
272
345
  var hasDocumentElement = false;
273
346
  var hasSentDoctype = false;
@@ -361,7 +434,7 @@ JSClass("JSXMLParser", JSObject, {
361
434
 
362
435
  });
363
436
 
364
- var textByDecodingEntities = function(text){
437
+ var textByDecodingEntities = function(text, map){
365
438
  var index = text.indexOf('&');
366
439
  var length = text.length;
367
440
  var end;
@@ -390,7 +463,7 @@ var textByDecodingEntities = function(text){
390
463
  value = String.fromCharCode(code);
391
464
  }
392
465
  }else{
393
- value = entityMap[entity] || null;
466
+ value = map[entity] || null;
394
467
  if (value === null){
395
468
  throw new Error("Cannot lookup entity: &" + entity + ';');
396
469
  }
@@ -404,7 +477,7 @@ var textByDecodingEntities = function(text){
404
477
  return text;
405
478
  };
406
479
 
407
- var entityMap = {
480
+ var defaultEntityMap = {
408
481
  'lt': '<',
409
482
  'LT': '<',
410
483
  'gt': '>',
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.Foundation",
6
- "JSBundleVersion": "2022.7.0",
6
+ "JSBundleVersion": "2022.11.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
11
11
  "node": "Foundation+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
14
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
15
15
  },
16
16
  "Resources": [
17
17
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "JSBundleType": "framework",
3
3
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
4
- "JSBundleVersion": "2022.7.0",
4
+ "JSBundleVersion": "2022.11.0",
5
5
  "JSDevelopmentLanguage": "en",
6
6
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
7
7
  "JSBundleEnvironments": {
@@ -9,5 +9,5 @@
9
9
  "node": "SecurityKit+Node.js"
10
10
  },
11
11
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
12
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
12
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
13
13
  }
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "framework",
5
5
  "JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
6
- "JSBundleVersion": "2022.7.0",
6
+ "JSBundleVersion": "2022.11.0",
7
7
  "JSDevelopmentLanguage": "en",
8
8
  "JSCopyright": "Copyright © 2020 Breakside Inc.",
9
9
  "JSBundleEnvironments": {
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
11
11
  "node": "SecurityKit+Node.js"
12
12
  },
13
13
  "JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
14
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
14
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
15
15
  },
16
16
  "Resources": [],
17
17
  "ResourceLookup": {
package/Info.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "JSBundleType": "node",
3
3
  "JSBundleIdentifier": "io.breakside.jskit",
4
- "JSBundleVersion": "2022.7.0",
4
+ "JSBundleVersion": "2022.11.0",
5
5
  "JSExecutableName": "jskit",
6
6
  "NPMOrganization": "breakside",
7
7
  "JSResources": [
8
8
  "Tests/HTMLTestRunner.js",
9
9
  "Tests/NodeTestRunner.js"
10
10
  ],
11
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
11
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
12
12
  }
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2022.7.0",
6
+ "JSBundleVersion": "2022.11.0",
7
7
  "JSExecutableName": "jskit",
8
8
  "NPMOrganization": "breakside",
9
9
  "JSResources": [
10
10
  "Tests/HTMLTestRunner.js",
11
11
  "Tests/NodeTestRunner.js"
12
12
  ],
13
- "GitRevision": "0c7fd41e9df334845f377bdde35e29dca1b45490"
13
+ "GitRevision": "7a79fc99aad9e09bba303eb9bc57b05f53242951"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.AuthKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.CSSOM
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ChartKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  # JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ConferenceKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -246,7 +246,8 @@ JSClass("DBRedisStore", DBObjectStore, {
246
246
  this.cleanupWatchClientQueueTimer.invalidate();
247
247
  this.cleanupWatchClientQueueTimer = null;
248
248
  }
249
- return this.watchClientQueue.shift();
249
+ completion.call(target, this.watchClientQueue.shift());
250
+ return;
250
251
  }
251
252
  logger.info("opening watch client to %{public}:%d", this.url.host, this.url.port || 6379);
252
253
  var client = this.redis.createClient({url: this.url.encodedString, legacyMode: true});
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DBKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.DOM
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Dispatch
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -43,8 +43,10 @@ JSClass("JSHTMLDispatchQueue", JSWorkerBasedDispatchQueue, {
43
43
  },
44
44
 
45
45
  close: function(){
46
- this.worker.terminate();
47
- this.worker = null;
46
+ if (this.worker !== null){
47
+ this.worker.terminate();
48
+ this.worker = null;
49
+ }
48
50
  }
49
51
 
50
52
  });
@@ -42,13 +42,16 @@ JSClass("FNTFontDescriptor", JSDataFontDescriptor, {
42
42
  }
43
43
  var os2 = this.font.tables['OS/2'];
44
44
  if (os2){
45
- this._weight = Math.floor(os2.weight / 100) * 100;
46
- this._style = (os2.selection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
45
+ this._weight = Math.floor(os2.usWeightClass / 100) * 100;
46
+ this._style = (os2.fsSelection & 0x1) ? JSFont.Style.italic : JSFont.Style.normal;
47
+ }
48
+ var name = font.tables.name;
49
+ if (name){
50
+ this._family = name.family;
51
+ this._postScriptName = name.postscript;
52
+ this._face = name.face;
53
+ this._name = name.fullName;
47
54
  }
48
- // this._family
49
- // this._name
50
- // this._face
51
- // this._postScriptName
52
55
  this._characterToGlyphMap = {};
53
56
  this._glyphToCharacterMap = {};
54
57
  },
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.Foundation
3
- JSBundleVersion: 2022.7.0
3
+ JSBundleVersion: 2022.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -38,7 +38,15 @@ JSClass("JSHTMLHTTPClient", JSObject, {
38
38
  }
39
39
  };
40
40
  var failEventHandler = function(e){
41
- complete(new Error(e.type));
41
+ if (e.type == "error"){
42
+ complete(new Error("XMLHttpRequest error (network down, timeout, CORS, etc)"));
43
+ }else if (e.type == "timeout"){
44
+ complete(new Error("XMLHttpRequest timeout"));
45
+ }else if (e.type == "abort"){
46
+ complete(new Error("XMLHttpRequest aborted"));
47
+ }else{
48
+ complete(new Error("XMLHttpRequest failed with event: " + e.type));
49
+ }
42
50
  };
43
51
  try {
44
52
  var response = null;
@@ -417,7 +417,7 @@ _JSDataImage.sizeFromSVGData = function(data){
417
417
  size.width = px(attrs.width);
418
418
  size.height = px(attrs.height);
419
419
  }else if (attrs.viewBox){
420
- var box = attrs.viewBox.split(/\s+/).map(function(n){ parseInt(n); });
420
+ var box = attrs.viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
421
421
  size.width = box[2];
422
422
  size.height = box[3];
423
423
  }
@@ -449,14 +449,21 @@ JSClass("_JSURLImage", JSImage, {
449
449
 
450
450
  getData: function(completion, target){
451
451
  if (!completion){
452
- completion = Promise.completion(Promise.resolveNonNull);
452
+ completion = Promise.completion(Promise.rejectNonNullSecondArgument);
453
453
  }
454
454
  var session = JSURLSession.shared;
455
455
  var task = session.dataTaskWithURL(this.url, function(error){
456
- if (error !== null || task.response.statusClass != JSURLResponse.StatusClass.success){
457
- completion.call(target, null);
456
+ if (error !== null){
457
+ completion.call(target, null, error);
458
+ return;
459
+ }
460
+ try{
461
+ task.response.assertSuccess();
462
+ }catch (e){
463
+ completion.call(target, null, e);
464
+ return;
458
465
  }
459
- completion.call(target, task.response.data);
466
+ completion.call(target, task.response.data, null);
460
467
  });
461
468
  task.resume();
462
469
  return completion.promise;
@@ -163,6 +163,16 @@ JSURLResponse.StatusClass = {
163
163
  serverError: 5
164
164
  };
165
165
 
166
+ JSURLResponse.error = function(statusCode, object){
167
+ var response = JSURLResponse.init();
168
+ response.statusCode = statusCode;
169
+ if (object !== undefined){
170
+ response.data = JSON.stringify(object).utf8();
171
+ response.headerMap.add("Content-Type", response.jsonMime);
172
+ }
173
+ return new JSURLResponseError(response);
174
+ };
175
+
166
176
  JSGlobalObject.JSURLResponseError = function(response){
167
177
  if (this === undefined){
168
178
  return new JSURLResponseError();