MCPcopy Index your code
hub / github.com/microsoft/SandDance / _safeCreateImageBitmap

Function _safeCreateImageBitmap

docs/app/js/sanddance-app.js:57714–57753  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57712 return _safeCreateImageBitmap.apply(this, arguments);
57713}
57714function _safeCreateImageBitmap() {
57715 _safeCreateImageBitmap = (0, _asyncToGeneratorDefault.default)((0, _regeneratorDefault.default).mark(function _callee2(blob) {
57716 var imagebitmapOptions, _args2 = arguments;
57717 return (0, _regeneratorDefault.default).wrap(function _callee2$(_context2) {
57718 while(true)switch(_context2.prev = _context2.next){
57719 case 0:
57720 imagebitmapOptions = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
57721 if (isEmptyObject(imagebitmapOptions) || !imagebitmapOptionsSupported) imagebitmapOptions = null;
57722 if (!imagebitmapOptions) {
57723 _context2.next = 13;
57724 break;
57725 }
57726 _context2.prev = 3;
57727 _context2.next = 6;
57728 return createImageBitmap(blob, imagebitmapOptions);
57729 case 6:
57730 return _context2.abrupt("return", _context2.sent);
57731 case 9:
57732 _context2.prev = 9;
57733 _context2.t0 = _context2["catch"](3);
57734 console.warn(_context2.t0);
57735 imagebitmapOptionsSupported = false;
57736 case 13:
57737 _context2.next = 15;
57738 return createImageBitmap(blob);
57739 case 15:
57740 return _context2.abrupt("return", _context2.sent);
57741 case 16:
57742 case "end":
57743 return _context2.stop();
57744 }
57745 }, _callee2, null, [
57746 [
57747 3,
57748 9
57749 ]
57750 ]);
57751 }));
57752 return _safeCreateImageBitmap.apply(this, arguments);
57753}
57754function isEmptyObject(object) {
57755 for(var key in object || EMPTY_OBJECT)return false;
57756 return true;

Callers

nothing calls this directly

Calls 2

isEmptyObjectFunction · 0.70
warnMethod · 0.45

Tested by

no test coverage detected