@openui5/sap.ui.core 1.120.37 → 1.120.39

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 (265) hide show
  1. package/.reuse/dep5 +1 -1
  2. package/THIRDPARTY.txt +2 -2
  3. package/package.json +1 -1
  4. package/src/jquery.sap.global.js +1 -1
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  9. package/src/sap/base/Event.js +1 -1
  10. package/src/sap/base/Eventing.js +1 -1
  11. package/src/sap/base/config.js +1 -1
  12. package/src/sap/base/i18n/LanguageTag.js +1 -1
  13. package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
  14. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  15. package/src/sap/base/util/restricted/_castArray.js +1 -1
  16. package/src/sap/base/util/restricted/_compact.js +1 -1
  17. package/src/sap/base/util/restricted/_curry.js +1 -1
  18. package/src/sap/base/util/restricted/_debounce.js +1 -1
  19. package/src/sap/base/util/restricted/_difference.js +1 -1
  20. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  22. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_flatten.js +1 -1
  26. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  28. package/src/sap/base/util/restricted/_intersection.js +1 -1
  29. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  31. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  33. package/src/sap/base/util/restricted/_isNil.js +1 -1
  34. package/src/sap/base/util/restricted/_max.js +1 -1
  35. package/src/sap/base/util/restricted/_merge.js +1 -1
  36. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  37. package/src/sap/base/util/restricted/_min.js +1 -1
  38. package/src/sap/base/util/restricted/_omit.js +1 -1
  39. package/src/sap/base/util/restricted/_pick.js +1 -1
  40. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  41. package/src/sap/base/util/restricted/_throttle.js +1 -1
  42. package/src/sap/base/util/restricted/_toArray.js +1 -1
  43. package/src/sap/base/util/restricted/_union.js +1 -1
  44. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  45. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  46. package/src/sap/base/util/restricted/_uniq.js +1 -1
  47. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  49. package/src/sap/base/util/restricted/_without.js +1 -1
  50. package/src/sap/base/util/restricted/_xor.js +1 -1
  51. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  52. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  53. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  55. package/src/sap/ui/Device.js +3 -3
  56. package/src/sap/ui/Global.js +4 -4
  57. package/src/sap/ui/base/Event.js +1 -1
  58. package/src/sap/ui/base/EventProvider.js +1 -1
  59. package/src/sap/ui/base/Interface.js +1 -1
  60. package/src/sap/ui/base/ManagedObject.js +1 -1
  61. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  62. package/src/sap/ui/base/Metadata.js +1 -1
  63. package/src/sap/ui/base/Object.js +1 -1
  64. package/src/sap/ui/base/ObjectPool.js +1 -1
  65. package/src/sap/ui/core/.library +6 -6
  66. package/src/sap/ui/core/BusyIndicator.js +1 -1
  67. package/src/sap/ui/core/Component.js +1 -1
  68. package/src/sap/ui/core/ComponentContainer.js +1 -1
  69. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  70. package/src/sap/ui/core/ComponentSupport.js +1 -1
  71. package/src/sap/ui/core/Configuration.js +1 -1
  72. package/src/sap/ui/core/Control.js +1 -1
  73. package/src/sap/ui/core/Core.js +1 -1
  74. package/src/sap/ui/core/CustomData.js +1 -1
  75. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  76. package/src/sap/ui/core/Element.js +1 -1
  77. package/src/sap/ui/core/ElementMetadata.js +1 -1
  78. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  79. package/src/sap/ui/core/EventBus.js +1 -1
  80. package/src/sap/ui/core/Fragment.js +1 -1
  81. package/src/sap/ui/core/HTML.js +1 -1
  82. package/src/sap/ui/core/History.js +1 -1
  83. package/src/sap/ui/core/Icon.js +1 -1
  84. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  85. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  86. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  87. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  88. package/src/sap/ui/core/InvisibleText.js +1 -1
  89. package/src/sap/ui/core/Item.js +1 -1
  90. package/src/sap/ui/core/LabelEnablement.js +1 -1
  91. package/src/sap/ui/core/LayoutData.js +1 -1
  92. package/src/sap/ui/core/ListItem.js +1 -1
  93. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  94. package/src/sap/ui/core/Locale.js +1 -1
  95. package/src/sap/ui/core/LocaleData.js +1 -1
  96. package/src/sap/ui/core/Manifest.js +1 -1
  97. package/src/sap/ui/core/Message.js +1 -1
  98. package/src/sap/ui/core/RenderManager.js +1 -1
  99. package/src/sap/ui/core/Renderer.js +1 -1
  100. package/src/sap/ui/core/ResizeHandler.js +1 -1
  101. package/src/sap/ui/core/ScrollBar.js +1 -1
  102. package/src/sap/ui/core/SeparatorItem.js +1 -1
  103. package/src/sap/ui/core/ShortcutHintsMixin.js +13 -1
  104. package/src/sap/ui/core/Title.js +1 -1
  105. package/src/sap/ui/core/TooltipBase.js +1 -1
  106. package/src/sap/ui/core/UIArea.js +1 -1
  107. package/src/sap/ui/core/UIComponent.js +1 -1
  108. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  109. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  110. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  111. package/src/sap/ui/core/XMLComposite.js +1 -1
  112. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  113. package/src/sap/ui/core/date/UI5Date.js +1 -1
  114. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  115. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  116. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  117. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  118. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  119. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  120. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  121. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  122. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  123. package/src/sap/ui/core/library.js +3 -3
  124. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  125. package/src/sap/ui/core/message/Message.js +1 -1
  126. package/src/sap/ui/core/message/MessageManager.js +1 -1
  127. package/src/sap/ui/core/message/MessageParser.js +1 -1
  128. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  129. package/src/sap/ui/core/messagebundle_es.properties +20 -20
  130. package/src/sap/ui/core/messagebundle_fi.properties +1 -1
  131. package/src/sap/ui/core/messagebundle_id.properties +1 -1
  132. package/src/sap/ui/core/messagebundle_it.properties +1 -1
  133. package/src/sap/ui/core/messagebundle_kk.properties +8 -8
  134. package/src/sap/ui/core/messagebundle_th.properties +1 -1
  135. package/src/sap/ui/core/messagebundle_uk.properties +1 -1
  136. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  137. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  138. package/src/sap/ui/core/mvc/JSView.js +1 -1
  139. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  140. package/src/sap/ui/core/mvc/View.js +1 -1
  141. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  142. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  143. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  144. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  145. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  146. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  147. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  148. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  149. package/src/sap/ui/core/service/Service.js +1 -1
  150. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  151. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  152. package/src/sap/ui/core/support/Plugin.js +1 -1
  153. package/src/sap/ui/core/support/Support.js +1 -1
  154. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  156. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  158. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  159. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  160. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  161. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  162. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  163. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  164. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  165. package/src/sap/ui/core/tmpl/Template.js +1 -1
  166. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  167. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  168. package/src/sap/ui/core/util/Export.js +1 -1
  169. package/src/sap/ui/core/util/ExportCell.js +1 -1
  170. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  171. package/src/sap/ui/core/util/ExportRow.js +1 -1
  172. package/src/sap/ui/core/util/ExportType.js +1 -1
  173. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  174. package/src/sap/ui/core/util/File.js +1 -1
  175. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  176. package/src/sap/ui/core/util/MockServer.js +1 -1
  177. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  178. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  179. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  180. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  181. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  182. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  183. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  184. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  185. package/src/sap/ui/core/webc/WebComponent.js +1 -1
  186. package/src/sap/ui/core/webc/WebComponentMetadata.js +1 -1
  187. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  188. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  189. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  190. package/src/sap/ui/debug/ControlTree.js +1 -1
  191. package/src/sap/ui/debug/DebugEnv.js +1 -1
  192. package/src/sap/ui/debug/PropertyList.js +1 -1
  193. package/src/sap/ui/model/ClientModel.js +1 -1
  194. package/src/sap/ui/model/CompositeDataState.js +1 -1
  195. package/src/sap/ui/model/CompositeType.js +1 -1
  196. package/src/sap/ui/model/DataState.js +1 -1
  197. package/src/sap/ui/model/MetaModel.js +1 -1
  198. package/src/sap/ui/model/Model.js +1 -1
  199. package/src/sap/ui/model/SelectionModel.js +1 -1
  200. package/src/sap/ui/model/SimpleType.js +1 -1
  201. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  202. package/src/sap/ui/model/Type.js +1 -1
  203. package/src/sap/ui/model/json/JSONModel.js +1 -1
  204. package/src/sap/ui/model/message/MessageModel.js +1 -1
  205. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  206. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  207. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  208. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  209. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  210. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  211. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  212. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  213. package/src/sap/ui/model/odata/type/Date.js +1 -1
  214. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  215. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  216. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  217. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  218. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  219. package/src/sap/ui/model/odata/type/Double.js +1 -1
  220. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  221. package/src/sap/ui/model/odata/type/Int.js +1 -1
  222. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  223. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  224. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  225. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  226. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  227. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  228. package/src/sap/ui/model/odata/type/Single.js +1 -1
  229. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  230. package/src/sap/ui/model/odata/type/String.js +1 -1
  231. package/src/sap/ui/model/odata/type/Time.js +1 -1
  232. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  233. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  234. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  235. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  236. package/src/sap/ui/model/odata/v2/ODataModel.js +4 -3
  237. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +14 -9
  238. package/src/sap/ui/model/odata/v4/Context.js +1 -1
  239. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  240. package/src/sap/ui/model/odata/v4/ODataListBinding.js +2 -2
  241. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
  242. package/src/sap/ui/model/odata/v4/ODataModel.js +1 -1
  243. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  244. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  245. package/src/sap/ui/model/type/Boolean.js +1 -1
  246. package/src/sap/ui/model/type/Currency.js +1 -1
  247. package/src/sap/ui/model/type/Date.js +1 -1
  248. package/src/sap/ui/model/type/DateInterval.js +1 -1
  249. package/src/sap/ui/model/type/DateTime.js +1 -1
  250. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  251. package/src/sap/ui/model/type/FileSize.js +1 -1
  252. package/src/sap/ui/model/type/Float.js +1 -1
  253. package/src/sap/ui/model/type/Integer.js +1 -1
  254. package/src/sap/ui/model/type/String.js +1 -1
  255. package/src/sap/ui/model/type/Time.js +1 -1
  256. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  257. package/src/sap/ui/model/type/Unit.js +1 -1
  258. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  259. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  260. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  261. package/src/sap/ui/test/generic/TestBase.js +1 -1
  262. package/src/sap/ui/thirdparty/caja-html-sanitizer.js +8 -2
  263. package/src/sap/ui/thirdparty/jszip.js +44 -2
  264. package/src/sap/ui/thirdparty/require.js +255 -162
  265. package/src/sap/ui/util/Storage.js +1 -1
@@ -1,7 +1,6 @@
1
1
  /** vim: et:ts=4:sw=4:sts=4
2
- * @license RequireJS 2.1.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
3
- * Available via the MIT or new BSD license.
4
- * see: http://github.com/jrburke/requirejs for details
2
+ * @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors.
3
+ * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
5
4
  */
6
5
  //Not using strict: uneven strict support in browsers, #392, and causes
7
6
  //problems with requirejs.exec()/transpiler plugins that may not be strict.
@@ -9,20 +8,18 @@
9
8
  /*global window, navigator, document, importScripts, setTimeout, opera */
10
9
 
11
10
  var requirejs, require, define;
12
- (function (global) {
11
+ (function (global, setTimeout) {
13
12
  var req, s, head, baseElement, dataMain, src,
14
13
  interactiveScript, currentlyAddingScript, mainScript, subPath,
15
- version = '2.1.8',
16
- commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
14
+ version = '2.3.7',
15
+ commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,
17
16
  cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
18
17
  jsSuffixRegExp = /\.js$/,
19
18
  currDirRegExp = /^\.\//,
20
19
  op = Object.prototype,
21
20
  ostring = op.toString,
22
21
  hasOwn = op.hasOwnProperty,
23
- ap = Array.prototype,
24
- apsp = ap.splice,
25
- isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
22
+ isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
26
23
  isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
27
24
  //PS3 indicates loaded and complete, but need to wait for complete
28
25
  //specifically. Sequence is 'loading', 'loaded', execution,
@@ -36,7 +33,13 @@ var requirejs, require, define;
36
33
  contexts = {},
37
34
  cfg = {},
38
35
  globalDefQueue = [],
39
- useInteractive = false;
36
+ useInteractive = false,
37
+ disallowedProps = ['__proto__', 'constructor'];
38
+
39
+ //Could match something like ')//comment', do not lose the prefix to comment.
40
+ function commentReplace(match, singlePrefix) {
41
+ return singlePrefix || '';
42
+ }
40
43
 
41
44
  function isFunction(it) {
42
45
  return ostring.call(it) === '[object Function]';
@@ -92,7 +95,7 @@ var requirejs, require, define;
92
95
  function eachProp(obj, func) {
93
96
  var prop;
94
97
  for (prop in obj) {
95
- if (hasProp(obj, prop)) {
98
+ if (hasProp(obj, prop) && disallowedProps.indexOf(prop) == -1) {
96
99
  if (func(obj[prop], prop)) {
97
100
  break;
98
101
  }
@@ -108,7 +111,10 @@ var requirejs, require, define;
108
111
  if (source) {
109
112
  eachProp(source, function (value, prop) {
110
113
  if (force || !hasProp(target, prop)) {
111
- if (deepStringMixin && typeof value !== 'string') {
114
+ if (deepStringMixin && typeof value === 'object' && value &&
115
+ !isArray(value) && !isFunction(value) &&
116
+ !(value instanceof RegExp)) {
117
+
112
118
  if (!target[prop]) {
113
119
  target[prop] = {};
114
120
  }
@@ -138,7 +144,7 @@ var requirejs, require, define;
138
144
  throw err;
139
145
  }
140
146
 
141
- //Allow getting a global that expressed in
147
+ //Allow getting a global that is expressed in
142
148
  //dot notation, like 'a.b.c'.
143
149
  function getGlobal(value) {
144
150
  if (!value) {
@@ -160,7 +166,7 @@ var requirejs, require, define;
160
166
  * @returns {Error}
161
167
  */
162
168
  function makeError(id, msg, err, requireModules) {
163
- var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
169
+ var e = new Error(msg + '\nhttps://requirejs.org/docs/errors.html#' + id);
164
170
  e.requireType = id;
165
171
  e.requireModules = requireModules;
166
172
  if (err) {
@@ -177,7 +183,7 @@ var requirejs, require, define;
177
183
 
178
184
  if (typeof requirejs !== 'undefined') {
179
185
  if (isFunction(requirejs)) {
180
- //Do not overwrite and existing requirejs instance.
186
+ //Do not overwrite an existing requirejs instance.
181
187
  return;
182
188
  }
183
189
  cfg = requirejs;
@@ -201,6 +207,7 @@ var requirejs, require, define;
201
207
  waitSeconds: 7,
202
208
  baseUrl: './',
203
209
  paths: {},
210
+ bundles: {},
204
211
  pkgs: {},
205
212
  shim: {},
206
213
  config: {}
@@ -214,6 +221,7 @@ var requirejs, require, define;
214
221
  defQueue = [],
215
222
  defined = {},
216
223
  urlFetched = {},
224
+ bundlesMap = {},
217
225
  requireCounter = 1,
218
226
  unnormalizedCounter = 1;
219
227
 
@@ -228,20 +236,19 @@ var requirejs, require, define;
228
236
  */
229
237
  function trimDots(ary) {
230
238
  var i, part;
231
- for (i = 0; ary[i]; i += 1) {
239
+ for (i = 0; i < ary.length; i++) {
232
240
  part = ary[i];
233
241
  if (part === '.') {
234
242
  ary.splice(i, 1);
235
243
  i -= 1;
236
244
  } else if (part === '..') {
237
- if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
238
- //End of the line. Keep at least one non-dot
239
- //path segment at the front so it can be mapped
240
- //correctly to disk. Otherwise, there is likely
241
- //no path mapping for a path starting with '..'.
242
- //This can still fail, but catches the most reasonable
243
- //uses of ..
244
- break;
245
+ // If at the start, or previous value is still ..,
246
+ // keep them so that when converted to a path it may
247
+ // still work when converted to a path, even though
248
+ // as an ID it is less than ideal. In larger point
249
+ // releases, may be better to just kick out an error.
250
+ if (i === 0 || (i === 1 && ary[2] === '..') || ary[i - 1] === '..') {
251
+ continue;
245
252
  } else if (i > 0) {
246
253
  ary.splice(i - 1, 2);
247
254
  i -= 2;
@@ -261,54 +268,45 @@ var requirejs, require, define;
261
268
  * @returns {String} normalized name
262
269
  */
263
270
  function normalize(name, baseName, applyMap) {
264
- var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment,
265
- foundMap, foundI, foundStarMap, starI,
266
- baseParts = baseName && baseName.split('/'),
267
- normalizedBaseParts = baseParts,
271
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
272
+ foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
273
+ baseParts = (baseName && baseName.split('/')),
268
274
  map = config.map,
269
275
  starMap = map && map['*'];
270
276
 
271
277
  //Adjust any relative paths.
272
- if (name && name.charAt(0) === '.') {
273
- //If have a base name, try to normalize against it,
274
- //otherwise, assume it is a top-level require that will
275
- //be relative to baseUrl in the end.
276
- if (baseName) {
277
- if (getOwn(config.pkgs, baseName)) {
278
- //If the baseName is a package name, then just treat it as one
279
- //name to concat the name with.
280
- normalizedBaseParts = baseParts = [baseName];
281
- } else {
282
- //Convert baseName to array, and lop off the last part,
283
- //so that . matches that 'directory' and not name of the baseName's
284
- //module. For instance, baseName of 'one/two/three', maps to
285
- //'one/two/three.js', but we want the directory, 'one/two' for
286
- //this normalization.
287
- normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
288
- }
289
-
290
- name = normalizedBaseParts.concat(name.split('/'));
291
- trimDots(name);
278
+ if (name) {
279
+ name = name.split('/');
280
+ lastIndex = name.length - 1;
281
+
282
+ // If wanting node ID compatibility, strip .js from end
283
+ // of IDs. Have to do this here, and not in nameToUrl
284
+ // because node allows either .js or non .js to map
285
+ // to same file.
286
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
287
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
288
+ }
292
289
 
293
- //Some use of packages may use a . path to reference the
294
- //'main' module name, so normalize for that.
295
- pkgConfig = getOwn(config.pkgs, (pkgName = name[0]));
296
- name = name.join('/');
297
- if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
298
- name = pkgName;
299
- }
300
- } else if (name.indexOf('./') === 0) {
301
- // No baseName, so this is ID is resolved relative
302
- // to baseUrl, pull off the leading dot.
303
- name = name.substring(2);
290
+ // Starts with a '.' so need the baseName
291
+ if (name[0].charAt(0) === '.' && baseParts) {
292
+ //Convert baseName to array, and lop off the last part,
293
+ //so that . matches that 'directory' and not name of the baseName's
294
+ //module. For instance, baseName of 'one/two/three', maps to
295
+ //'one/two/three.js', but we want the directory, 'one/two' for
296
+ //this normalization.
297
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
298
+ name = normalizedBaseParts.concat(name);
304
299
  }
300
+
301
+ trimDots(name);
302
+ name = name.join('/');
305
303
  }
306
304
 
307
305
  //Apply map config if available.
308
306
  if (applyMap && map && (baseParts || starMap)) {
309
307
  nameParts = name.split('/');
310
308
 
311
- for (i = nameParts.length; i > 0; i -= 1) {
309
+ outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
312
310
  nameSegment = nameParts.slice(0, i).join('/');
313
311
 
314
312
  if (baseParts) {
@@ -325,16 +323,12 @@ var requirejs, require, define;
325
323
  //Match, update name to the new value.
326
324
  foundMap = mapValue;
327
325
  foundI = i;
328
- break;
326
+ break outerLoop;
329
327
  }
330
328
  }
331
329
  }
332
330
  }
333
331
 
334
- if (foundMap) {
335
- break;
336
- }
337
-
338
332
  //Check for a star map match, but just hold on to it,
339
333
  //if there is a shorter segment match later in a matching
340
334
  //config, then favor over this star map.
@@ -355,7 +349,11 @@ var requirejs, require, define;
355
349
  }
356
350
  }
357
351
 
358
- return name;
352
+ // If the name points to a package's name, use
353
+ // the package main instead.
354
+ pkgMain = getOwn(config.pkgs, name);
355
+
356
+ return pkgMain ? pkgMain : name;
359
357
  }
360
358
 
361
359
  function removeScript(name) {
@@ -373,12 +371,17 @@ var requirejs, require, define;
373
371
  function hasPathFallback(id) {
374
372
  var pathConfig = getOwn(config.paths, id);
375
373
  if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
376
- removeScript(id);
377
374
  //Pop off the first array value, since it failed, and
378
375
  //retry
379
376
  pathConfig.shift();
380
377
  context.require.undef(id);
381
- context.require([id]);
378
+
379
+ //Custom require that does not do map translation, since
380
+ //ID is "absolute", already mapped/resolved.
381
+ context.makeRequire(null, {
382
+ skipMap: true
383
+ })([id]);
384
+
382
385
  return true;
383
386
  }
384
387
  }
@@ -438,13 +441,24 @@ var requirejs, require, define;
438
441
  //Account for relative paths if there is a base name.
439
442
  if (name) {
440
443
  if (prefix) {
441
- if (pluginModule && pluginModule.normalize) {
444
+ if (isNormalized) {
445
+ normalizedName = name;
446
+ } else if (pluginModule && pluginModule.normalize) {
442
447
  //Plugin is loaded, use its normalize method.
443
448
  normalizedName = pluginModule.normalize(name, function (name) {
444
449
  return normalize(name, parentName, applyMap);
445
450
  });
446
451
  } else {
447
- normalizedName = normalize(name, parentName, applyMap);
452
+ // If nested plugin references, then do not try to
453
+ // normalize, as it will not normalize correctly. This
454
+ // places a restriction on resourceIds, and the longer
455
+ // term solution is not to normalize until plugins are
456
+ // loaded and all normalizations to allow for async
457
+ // loading of a loader plugin. But for now, fixes the
458
+ // common uses. Details in #1131
459
+ normalizedName = name.indexOf('!') === -1 ?
460
+ normalize(name, parentName, applyMap) :
461
+ name;
448
462
  }
449
463
  } else {
450
464
  //A regular module.
@@ -545,11 +559,13 @@ var requirejs, require, define;
545
559
  function takeGlobalQueue() {
546
560
  //Push all the globalDefQueue items into the context's defQueue
547
561
  if (globalDefQueue.length) {
548
- //Array splice in the values since the context code has a
549
- //local var ref to defQueue, so cannot just reassign the one
550
- //on context.
551
- apsp.apply(defQueue,
552
- [defQueue.length - 1, 0].concat(globalDefQueue));
562
+ each(globalDefQueue, function(queueItem) {
563
+ var id = queueItem[0];
564
+ if (typeof id === 'string') {
565
+ context.defQueueMap[id] = true;
566
+ }
567
+ defQueue.push(queueItem);
568
+ });
553
569
  globalDefQueue = [];
554
570
  }
555
571
  }
@@ -566,7 +582,7 @@ var requirejs, require, define;
566
582
  mod.usingExports = true;
567
583
  if (mod.map.isDefine) {
568
584
  if (mod.exports) {
569
- return mod.exports;
585
+ return (defined[mod.map.id] = mod.exports);
570
586
  } else {
571
587
  return (mod.exports = defined[mod.map.id] = {});
572
588
  }
@@ -580,15 +596,9 @@ var requirejs, require, define;
580
596
  id: mod.map.id,
581
597
  uri: mod.map.url,
582
598
  config: function () {
583
- var c,
584
- pkg = getOwn(config.pkgs, mod.map.id);
585
- // For packages, only support config targeted
586
- // at the main module.
587
- c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
588
- getOwn(config.config, mod.map.id);
589
- return c || {};
599
+ return getOwn(config.config, mod.map.id) || {};
590
600
  },
591
- exports: defined[mod.map.id]
601
+ exports: mod.exports || (mod.exports = {})
592
602
  });
593
603
  }
594
604
  }
@@ -629,7 +639,7 @@ var requirejs, require, define;
629
639
  }
630
640
 
631
641
  function checkLoaded() {
632
- var map, modId, err, usingPathFallback,
642
+ var err, usingPathFallback,
633
643
  waitInterval = config.waitSeconds * 1000,
634
644
  //It is possible to disable the wait interval by using waitSeconds of 0.
635
645
  expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
@@ -647,8 +657,8 @@ var requirejs, require, define;
647
657
 
648
658
  //Figure out the state of all the modules.
649
659
  eachProp(enabledRegistry, function (mod) {
650
- map = mod.map;
651
- modId = map.id;
660
+ var map = mod.map,
661
+ modId = map.id;
652
662
 
653
663
  //Skip things that are not enabled or in error state.
654
664
  if (!mod.enabled) {
@@ -842,7 +852,10 @@ var requirejs, require, define;
842
852
  factory = this.factory;
843
853
 
844
854
  if (!this.inited) {
845
- this.fetch();
855
+ // Only fetch if not already in the defQueue.
856
+ if (!hasProp(context.defQueueMap, id)) {
857
+ this.fetch();
858
+ }
846
859
  } else if (this.error) {
847
860
  this.emit('error', this.error);
848
861
  } else if (!this.defining) {
@@ -871,17 +884,14 @@ var requirejs, require, define;
871
884
  exports = context.execCb(id, factory, depExports, exports);
872
885
  }
873
886
 
874
- if (this.map.isDefine) {
875
- //If setting exports via 'module' is in play,
876
- //favor that over return value and exports. After that,
877
- //favor a non-undefined return value over exports use.
887
+ // Favor return value over exports. If node/cjs in play,
888
+ // then will not have a return value anyway. Favor
889
+ // module.exports assignment over exports object.
890
+ if (this.map.isDefine && exports === undefined) {
878
891
  cjsModule = this.module;
879
- if (cjsModule &&
880
- cjsModule.exports !== undefined &&
881
- //Make sure it is not already the exports value
882
- cjsModule.exports !== this.exports) {
892
+ if (cjsModule) {
883
893
  exports = cjsModule.exports;
884
- } else if (exports === undefined && this.usingExports) {
894
+ } else if (this.usingExports) {
885
895
  //exports already set the defined value.
886
896
  exports = this.exports;
887
897
  }
@@ -905,7 +915,11 @@ var requirejs, require, define;
905
915
  defined[id] = exports;
906
916
 
907
917
  if (req.onResourceLoad) {
908
- req.onResourceLoad(context, this.map, this.depMaps);
918
+ var resLoadMaps = [];
919
+ each(this.depMaps, function (depMap) {
920
+ resLoadMaps.push(depMap.normalizedMap || depMap);
921
+ });
922
+ req.onResourceLoad(context, this.map, resLoadMaps);
909
923
  }
910
924
  }
911
925
 
@@ -941,6 +955,7 @@ var requirejs, require, define;
941
955
 
942
956
  on(pluginMap, 'defined', bind(this, function (plugin) {
943
957
  var load, normalizedMap, normalizedMod,
958
+ bundleId = getOwn(bundlesMap, this.map.id),
944
959
  name = this.map.name,
945
960
  parentName = this.map.parentMap ? this.map.parentMap.name : null,
946
961
  localRequire = context.makeRequire(map.parentMap, {
@@ -960,9 +975,11 @@ var requirejs, require, define;
960
975
  //prefix and name should already be normalized, no need
961
976
  //for applying map config again either.
962
977
  normalizedMap = makeModuleMap(map.prefix + '!' + name,
963
- this.map.parentMap);
978
+ this.map.parentMap,
979
+ true);
964
980
  on(normalizedMap,
965
981
  'defined', bind(this, function (value) {
982
+ this.map.normalizedMap = normalizedMap;
966
983
  this.init([], function () { return value; }, null, {
967
984
  enabled: true,
968
985
  ignore: true
@@ -986,6 +1003,14 @@ var requirejs, require, define;
986
1003
  return;
987
1004
  }
988
1005
 
1006
+ //If a paths config, then just load that file instead to
1007
+ //resolve the plugin, as it is built into that paths layer.
1008
+ if (bundleId) {
1009
+ this.map.url = context.nameToUrl(bundleId);
1010
+ this.load();
1011
+ return;
1012
+ }
1013
+
989
1014
  load = bind(this, function (value) {
990
1015
  this.init([], function () { return value; }, null, {
991
1016
  enabled: true
@@ -1108,12 +1133,22 @@ var requirejs, require, define;
1108
1133
  this.depCount += 1;
1109
1134
 
1110
1135
  on(depMap, 'defined', bind(this, function (depExports) {
1136
+ if (this.undefed) {
1137
+ return;
1138
+ }
1111
1139
  this.defineDep(i, depExports);
1112
1140
  this.check();
1113
1141
  }));
1114
1142
 
1115
1143
  if (this.errback) {
1116
1144
  on(depMap, 'error', bind(this, this.errback));
1145
+ } else if (this.events.error) {
1146
+ // No direct errback on this module, but something
1147
+ // else is listening for errors, so be sure to
1148
+ // propagate the error correctly.
1149
+ on(depMap, 'error', bind(this, function(err) {
1150
+ this.emit('error', err);
1151
+ }));
1117
1152
  }
1118
1153
  }
1119
1154
 
@@ -1217,13 +1252,15 @@ var requirejs, require, define;
1217
1252
  while (defQueue.length) {
1218
1253
  args = defQueue.shift();
1219
1254
  if (args[0] === null) {
1220
- return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
1255
+ return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' +
1256
+ args[args.length - 1]));
1221
1257
  } else {
1222
1258
  //args are id, deps, factory. Should be normalized by the
1223
1259
  //define() function.
1224
1260
  callGetModule(args);
1225
1261
  }
1226
1262
  }
1263
+ context.defQueueMap = {};
1227
1264
  }
1228
1265
 
1229
1266
  context = {
@@ -1233,6 +1270,7 @@ var requirejs, require, define;
1233
1270
  defined: defined,
1234
1271
  urlFetched: urlFetched,
1235
1272
  defQueue: defQueue,
1273
+ defQueueMap: {},
1236
1274
  Module: Module,
1237
1275
  makeModuleMap: makeModuleMap,
1238
1276
  nextTick: req.nextTick,
@@ -1250,31 +1288,46 @@ var requirejs, require, define;
1250
1288
  }
1251
1289
  }
1252
1290
 
1253
- //Save off the paths and packages since they require special processing,
1291
+ // Convert old style urlArgs string to a function.
1292
+ if (typeof cfg.urlArgs === 'string') {
1293
+ var urlArgs = cfg.urlArgs;
1294
+ cfg.urlArgs = function(id, url) {
1295
+ return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs;
1296
+ };
1297
+ }
1298
+
1299
+ //Save off the paths since they require special processing,
1254
1300
  //they are additive.
1255
- var pkgs = config.pkgs,
1256
- shim = config.shim,
1301
+ var shim = config.shim,
1257
1302
  objs = {
1258
1303
  paths: true,
1304
+ bundles: true,
1259
1305
  config: true,
1260
1306
  map: true
1261
1307
  };
1262
1308
 
1263
1309
  eachProp(cfg, function (value, prop) {
1264
1310
  if (objs[prop]) {
1265
- if (prop === 'map') {
1266
- if (!config.map) {
1267
- config.map = {};
1268
- }
1269
- mixin(config[prop], value, true, true);
1270
- } else {
1271
- mixin(config[prop], value, true);
1311
+ if (!config[prop]) {
1312
+ config[prop] = {};
1272
1313
  }
1314
+ mixin(config[prop], value, true, true);
1273
1315
  } else {
1274
1316
  config[prop] = value;
1275
1317
  }
1276
1318
  });
1277
1319
 
1320
+ //Reverse map the bundles
1321
+ if (cfg.bundles) {
1322
+ eachProp(cfg.bundles, function (value, prop) {
1323
+ each(value, function (v) {
1324
+ if (v !== prop) {
1325
+ bundlesMap[v] = prop;
1326
+ }
1327
+ });
1328
+ });
1329
+ }
1330
+
1278
1331
  //Merge shim
1279
1332
  if (cfg.shim) {
1280
1333
  eachProp(cfg.shim, function (value, id) {
@@ -1295,29 +1348,25 @@ var requirejs, require, define;
1295
1348
  //Adjust packages if necessary.
1296
1349
  if (cfg.packages) {
1297
1350
  each(cfg.packages, function (pkgObj) {
1298
- var location;
1351
+ var location, name;
1352
+
1353
+ pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj;
1299
1354
 
1300
- pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
1355
+ name = pkgObj.name;
1301
1356
  location = pkgObj.location;
1357
+ if (location) {
1358
+ config.paths[name] = pkgObj.location;
1359
+ }
1302
1360
 
1303
- //Create a brand new object on pkgs, since currentPackages can
1304
- //be passed in again, and config.pkgs is the internal transformed
1305
- //state for all package configs.
1306
- pkgs[pkgObj.name] = {
1307
- name: pkgObj.name,
1308
- location: location || pkgObj.name,
1309
- //Remove leading dot in main, so main paths are normalized,
1310
- //and remove any trailing .js, since different package
1311
- //envs have different conventions: some use a module name,
1312
- //some use a file name.
1313
- main: (pkgObj.main || 'main')
1314
- .replace(currDirRegExp, '')
1315
- .replace(jsSuffixRegExp, '')
1316
- };
1361
+ //Save pointer to main module ID for pkg name.
1362
+ //Remove leading dot in main, so main paths are normalized,
1363
+ //and remove any trailing .js, since different package
1364
+ //envs have different conventions: some use a module name,
1365
+ //some use a file name.
1366
+ config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
1367
+ .replace(currDirRegExp, '')
1368
+ .replace(jsSuffixRegExp, '');
1317
1369
  });
1318
-
1319
- //Done with modifications, assing packages back to context config
1320
- config.pkgs = pkgs;
1321
1370
  }
1322
1371
 
1323
1372
  //If there are any "waiting to execute" modules in the registry,
@@ -1328,7 +1377,7 @@ var requirejs, require, define;
1328
1377
  //late to modify them, and ignore unnormalized ones
1329
1378
  //since they are transient.
1330
1379
  if (!mod.inited && !mod.map.unnormalized) {
1331
- mod.map = makeModuleMap(id);
1380
+ mod.map = makeModuleMap(id, null, true);
1332
1381
  }
1333
1382
  });
1334
1383
 
@@ -1464,10 +1513,23 @@ var requirejs, require, define;
1464
1513
  var map = makeModuleMap(id, relMap, true),
1465
1514
  mod = getOwn(registry, id);
1466
1515
 
1516
+ mod.undefed = true;
1517
+ removeScript(id);
1518
+
1467
1519
  delete defined[id];
1468
1520
  delete urlFetched[map.url];
1469
1521
  delete undefEvents[id];
1470
1522
 
1523
+ //Clean queued defines too. Go backwards
1524
+ //in array so that the splices do not
1525
+ //mess up the iteration.
1526
+ eachReverse(defQueue, function(args, i) {
1527
+ if (args[0] === id) {
1528
+ defQueue.splice(i, 1);
1529
+ }
1530
+ });
1531
+ delete context.defQueueMap[id];
1532
+
1471
1533
  if (mod) {
1472
1534
  //Hold on to listeners in case the
1473
1535
  //module will be attempted to be reloaded
@@ -1528,6 +1590,7 @@ var requirejs, require, define;
1528
1590
 
1529
1591
  callGetModule(args);
1530
1592
  }
1593
+ context.defQueueMap = {};
1531
1594
 
1532
1595
  //Do this after the cycle of callGetModule in case the result
1533
1596
  //of those calls/init calls changes the registry.
@@ -1561,8 +1624,19 @@ var requirejs, require, define;
1561
1624
  * internal API, not a public one. Use toUrl for the public API.
1562
1625
  */
1563
1626
  nameToUrl: function (moduleName, ext, skipExt) {
1564
- var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url,
1565
- parentPath;
1627
+ var paths, syms, i, parentModule, url,
1628
+ parentPath, bundleId,
1629
+ pkgMain = getOwn(config.pkgs, moduleName);
1630
+
1631
+ if (pkgMain) {
1632
+ moduleName = pkgMain;
1633
+ }
1634
+
1635
+ bundleId = getOwn(bundlesMap, moduleName);
1636
+
1637
+ if (bundleId) {
1638
+ return context.nameToUrl(bundleId, ext, skipExt);
1639
+ }
1566
1640
 
1567
1641
  //If a colon is in the URL, it indicates a protocol is used and it is just
1568
1642
  //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
@@ -1576,7 +1650,6 @@ var requirejs, require, define;
1576
1650
  } else {
1577
1651
  //A module that needs to be converted to a path.
1578
1652
  paths = config.paths;
1579
- pkgs = config.pkgs;
1580
1653
 
1581
1654
  syms = moduleName.split('/');
1582
1655
  //For each module name segment, see if there is a path
@@ -1584,7 +1657,7 @@ var requirejs, require, define;
1584
1657
  //and work up from it.
1585
1658
  for (i = syms.length; i > 0; i -= 1) {
1586
1659
  parentModule = syms.slice(0, i).join('/');
1587
- pkg = getOwn(pkgs, parentModule);
1660
+
1588
1661
  parentPath = getOwn(paths, parentModule);
1589
1662
  if (parentPath) {
1590
1663
  //If an array, it means there are a few choices,
@@ -1594,28 +1667,17 @@ var requirejs, require, define;
1594
1667
  }
1595
1668
  syms.splice(0, i, parentPath);
1596
1669
  break;
1597
- } else if (pkg) {
1598
- //If module name is just the package name, then looking
1599
- //for the main module.
1600
- if (moduleName === pkg.name) {
1601
- pkgPath = pkg.location + '/' + pkg.main;
1602
- } else {
1603
- pkgPath = pkg.location;
1604
- }
1605
- syms.splice(0, i, pkgPath);
1606
- break;
1607
1670
  }
1608
1671
  }
1609
1672
 
1610
1673
  //Join the path parts together, then figure out if baseUrl is needed.
1611
1674
  url = syms.join('/');
1612
- url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));
1675
+ url += (ext || (/^data\:|^blob\:|\?/.test(url) || skipExt ? '' : '.js'));
1613
1676
  url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
1614
1677
  }
1615
1678
 
1616
- return config.urlArgs ? url +
1617
- ((url.indexOf('?') === -1 ? '?' : '&') +
1618
- config.urlArgs) : url;
1679
+ return config.urlArgs && !/^blob\:/.test(url) ?
1680
+ url + config.urlArgs(moduleName, url) : url;
1619
1681
  },
1620
1682
 
1621
1683
  //Delegates to req.load. Broken out as a separate function to
@@ -1663,7 +1725,21 @@ var requirejs, require, define;
1663
1725
  onScriptError: function (evt) {
1664
1726
  var data = getScriptData(evt);
1665
1727
  if (!hasPathFallback(data.id)) {
1666
- return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
1728
+ var parents = [];
1729
+ eachProp(registry, function(value, key) {
1730
+ if (key.indexOf('_@r') !== 0) {
1731
+ each(value.depMaps, function(depMap) {
1732
+ if (depMap.id === data.id) {
1733
+ parents.push(key);
1734
+ return true;
1735
+ }
1736
+ });
1737
+ }
1738
+ });
1739
+ return onError(makeError('scripterror', 'Script error for "' + data.id +
1740
+ (parents.length ?
1741
+ '", needed by: ' + parents.join(', ') :
1742
+ '"'), evt, [data.id]));
1667
1743
  }
1668
1744
  }
1669
1745
  };
@@ -1837,11 +1913,11 @@ var requirejs, require, define;
1837
1913
  if (node.attachEvent &&
1838
1914
  //Check if node.attachEvent is artificially added by custom script or
1839
1915
  //natively supported by browser
1840
- //read https://github.com/jrburke/requirejs/issues/187
1916
+ //read https://github.com/requirejs/requirejs/issues/187
1841
1917
  //if we can NOT find [native code] then it must NOT natively supported.
1842
1918
  //in IE8, node.attachEvent does not have toString()
1843
1919
  //Note the test for "[native code" with no closing brace, see:
1844
- //https://github.com/jrburke/requirejs/issues/273
1920
+ //https://github.com/requirejs/requirejs/issues/273
1845
1921
  !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
1846
1922
  !isOpera) {
1847
1923
  //Probably IE. IE (at least 6-8) do not fire
@@ -1869,6 +1945,12 @@ var requirejs, require, define;
1869
1945
  }
1870
1946
  node.src = url;
1871
1947
 
1948
+ //Calling onNodeCreated after all properties on the node have been
1949
+ //set, but before it is placed in the DOM.
1950
+ if (config.onNodeCreated) {
1951
+ config.onNodeCreated(node, config, moduleName, url);
1952
+ }
1953
+
1872
1954
  //For some cache cases in IE 6-8, the script executes before the end
1873
1955
  //of the appendChild execution, so to tie an anonymous define
1874
1956
  //call to the module name (which is stored on the node), hold on
@@ -1887,9 +1969,14 @@ var requirejs, require, define;
1887
1969
  //In a web worker, use importScripts. This is not a very
1888
1970
  //efficient use of importScripts, importScripts will block until
1889
1971
  //its script is downloaded and evaluated. However, if web workers
1890
- //are in play, the expectation that a build has been done so that
1891
- //only one script needs to be loaded anyway. This may need to be
1892
- //reevaluated if other use cases become common.
1972
+ //are in play, the expectation is that a build has been done so
1973
+ //that only one script needs to be loaded anyway. This may need
1974
+ //to be reevaluated if other use cases become common.
1975
+
1976
+ // Post a task to the event loop to work around a bug in WebKit
1977
+ // where the worker gets garbage-collected after calling
1978
+ // importScripts(): https://webkit.org/b/153317
1979
+ setTimeout(function() {}, 0);
1893
1980
  importScripts(url);
1894
1981
 
1895
1982
  //Account for anonymous modules
@@ -1918,7 +2005,7 @@ var requirejs, require, define;
1918
2005
  }
1919
2006
 
1920
2007
  //Look for a data-main script attribute, which could also adjust the baseUrl.
1921
- if (isBrowser) {
2008
+ if (isBrowser && !cfg.skipDataMain) {
1922
2009
  //Figure out baseUrl. Get it from the script tag with require.js in it.
1923
2010
  eachReverse(scripts(), function (script) {
1924
2011
  //Set the 'head' where we can append children by
@@ -1935,8 +2022,10 @@ var requirejs, require, define;
1935
2022
  //Preserve dataMain in case it is a path (i.e. contains '?')
1936
2023
  mainScript = dataMain;
1937
2024
 
1938
- //Set final baseUrl if there is not already an explicit one.
1939
- if (!cfg.baseUrl) {
2025
+ //Set final baseUrl if there is not already an explicit one,
2026
+ //but only do so if the data-main value is not a loader plugin
2027
+ //module ID.
2028
+ if (!cfg.baseUrl && mainScript.indexOf('!') === -1) {
1940
2029
  //Pull off the directory of data-main for use as the
1941
2030
  //baseUrl.
1942
2031
  src = mainScript.split('/');
@@ -1950,7 +2039,7 @@ var requirejs, require, define;
1950
2039
  //like a module name.
1951
2040
  mainScript = mainScript.replace(jsSuffixRegExp, '');
1952
2041
 
1953
- //If mainScript is still a path, fall back to dataMain
2042
+ //If mainScript is still a path, fall back to dataMain
1954
2043
  if (req.jsExtRegExp.test(mainScript)) {
1955
2044
  mainScript = dataMain;
1956
2045
  }
@@ -1997,7 +2086,7 @@ var requirejs, require, define;
1997
2086
  if (callback.length) {
1998
2087
  callback
1999
2088
  .toString()
2000
- .replace(commentRegExp, '')
2089
+ .replace(commentRegExp, commentReplace)
2001
2090
  .replace(cjsRequireRegExp, function (match, dep) {
2002
2091
  deps.push(dep);
2003
2092
  });
@@ -2029,14 +2118,18 @@ var requirejs, require, define;
2029
2118
  //where the module name is not known until the script onload event
2030
2119
  //occurs. If no context, use the global queue, and get it processed
2031
2120
  //in the onscript load callback.
2032
- (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
2121
+ if (context) {
2122
+ context.defQueue.push([name, deps, callback]);
2123
+ context.defQueueMap[name] = true;
2124
+ } else {
2125
+ globalDefQueue.push([name, deps, callback]);
2126
+ }
2033
2127
  };
2034
2128
 
2035
2129
  define.amd = {
2036
2130
  jQuery: true
2037
2131
  };
2038
2132
 
2039
-
2040
2133
  /**
2041
2134
  * Executes the text. Normally just uses eval, but can be modified
2042
2135
  * to use a better, environment-specific call. Only used for transpiling
@@ -2050,4 +2143,4 @@ var requirejs, require, define;
2050
2143
 
2051
2144
  //Set up with config info.
2052
2145
  req(cfg);
2053
- }(this));
2146
+ }(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));