run-editor-sample-js.txt 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. © Microsoft. All rights reserved.
  3. https://microsoft.com
  4. blablahttp://en.wikipedia.org/wiki/Timisoara bla bla
  5. blabla http://en.wikipedia.org/wiki/Timisoara bla bla
  6. This library is supported for use in Windows Tailored Apps only.
  7. Build: 6.2.8100.0
  8. Version: 0.5
  9. */
  10. var קודמות = "מיותר קודמות צ'ט של, אם לשון העברית שינויים ויש, אם";
  11. 'a string\
  12. on multiple lines';
  13. (function (global, undefined) {
  14. "use strict";
  15. undefinedVariable = {}; undefinedVariable.bar = 5;
  16. undefinedVariable.foo = 5; undefinedVariable.baz = 10;
  17. function initializeProperties(target, members) {
  18. var keys = Object.keys(members);
  19. var properties;
  20. var i, len;
  21. for (i = 0, len = keys.length; i < len; i++) {
  22. var key = keys[i];
  23. var enumerable = key.charCodeAt(0) !== /*_*/95;
  24. var member = members[key];
  25. if (member && typeof member === 'object') {
  26. if (member.value !== undefined || typeof member.get === 'function' || typeof member.set === 'function') {
  27. if (member.enumerable === undefined) {
  28. member.enumerable = enumerable;
  29. }
  30. properties = properties || {};
  31. properties[key] = member;
  32. continue;
  33. }
  34. }
  35. if (!enumerable) {
  36. properties = properties || {};
  37. properties[key] = { value: member, enumerable: enumerable, configurable: true, writable: true }
  38. continue;
  39. }
  40. target[key] = member;
  41. }
  42. if (properties) {
  43. Object.defineProperties(target, properties);
  44. }
  45. }
  46. (function (rootNamespace) {
  47. // Create the rootNamespace in the global namespace
  48. if (!global[rootNamespace]) {
  49. global[rootNamespace] = Object.create(Object.prototype);
  50. }
  51. // Cache the rootNamespace we just created in a local variable
  52. var _rootNamespace = global[rootNamespace];
  53. if (!_rootNamespace.Namespace) {
  54. _rootNamespace.Namespace = Object.create(Object.prototype);
  55. }
  56. function defineWithParent(parentNamespace, name, members) {
  57. /// <summary locid="1">
  58. /// Defines a new namespace with the specified name, under the specified parent namespace.
  59. /// </summary>
  60. /// <param name="parentNamespace" type="Object" locid="2">
  61. /// The parent namespace which will contain the new namespace.
  62. /// </param>
  63. /// <param name="name" type="String" locid="3">
  64. /// Name of the new namespace.
  65. /// </param>
  66. /// <param name="members" type="Object" locid="4">
  67. /// Members in the new namespace.
  68. /// </param>
  69. /// <returns locid="5">
  70. /// The newly defined namespace.
  71. /// </returns>
  72. var currentNamespace = parentNamespace,
  73. namespaceFragments = name.split(".");
  74. for (var i = 0, len = namespaceFragments.length; i < len; i++) {
  75. var namespaceName = namespaceFragments[i];
  76. if (!currentNamespace[namespaceName]) {
  77. Object.defineProperty(currentNamespace, namespaceName,
  78. { value: {}, writable: false, enumerable: true, configurable: true }
  79. );
  80. }
  81. currentNamespace = currentNamespace[namespaceName];
  82. }
  83. if (members) {
  84. initializeProperties(currentNamespace, members);
  85. }
  86. return currentNamespace;
  87. };
  88. function define(name, members) {
  89. /// <summary locid="6">
  90. /// Defines a new namespace with the specified name.
  91. /// </summary>
  92. /// <param name="name" type="String" locid="7">
  93. /// Name of the namespace. This could be a dot-separated nested name.
  94. /// </param>
  95. /// <param name="members" type="Object" locid="4">
  96. /// Members in the new namespace.
  97. /// </param>
  98. /// <returns locid="5">
  99. /// The newly defined namespace.
  100. /// </returns>
  101. return defineWithParent(global, name, members);
  102. }
  103. // Establish members of the "WinJS.Namespace" namespace
  104. Object.defineProperties(_rootNamespace.Namespace, {
  105. defineWithParent: { value: defineWithParent, writable: true, enumerable: true },
  106. define: { value: define, writable: true, enumerable: true }
  107. });
  108. })("WinJS");
  109. (function (WinJS) {
  110. function define(constructor, instanceMembers, staticMembers) {
  111. /// <summary locid="8">
  112. /// Defines a class using the given constructor and with the specified instance members.
  113. /// </summary>
  114. /// <param name="constructor" type="Function" locid="9">
  115. /// A constructor function that will be used to instantiate this class.
  116. /// </param>
  117. /// <param name="instanceMembers" type="Object" locid="10">
  118. /// The set of instance fields, properties and methods to be made available on the class.
  119. /// </param>
  120. /// <param name="staticMembers" type="Object" locid="11">
  121. /// The set of static fields, properties and methods to be made available on the class.
  122. /// </param>
  123. /// <returns type="Function" locid="12">
  124. /// The newly defined class.
  125. /// </returns>
  126. constructor = constructor || function () { };
  127. if (instanceMembers) {
  128. initializeProperties(constructor.prototype, instanceMembers);
  129. }
  130. if (staticMembers) {
  131. initializeProperties(constructor, staticMembers);
  132. }
  133. return constructor;
  134. }
  135. function derive(baseClass, constructor, instanceMembers, staticMembers) {
  136. /// <summary locid="13">
  137. /// Uses prototypal inheritance to create a sub-class based on the supplied baseClass parameter.
  138. /// </summary>
  139. /// <param name="baseClass" type="Function" locid="14">
  140. /// The class to inherit from.
  141. /// </param>
  142. /// <param name="constructor" type="Function" locid="9">
  143. /// A constructor function that will be used to instantiate this class.
  144. /// </param>
  145. /// <param name="instanceMembers" type="Object" locid="10">
  146. /// The set of instance fields, properties and methods to be made available on the class.
  147. /// </param>
  148. /// <param name="staticMembers" type="Object" locid="11">
  149. /// The set of static fields, properties and methods to be made available on the class.
  150. /// </param>
  151. /// <returns type="Function" locid="12">
  152. /// The newly defined class.
  153. /// </returns>
  154. if (baseClass) {
  155. constructor = constructor || function () { };
  156. var basePrototype = baseClass.prototype;
  157. constructor.prototype = Object.create(basePrototype);
  158. Object.defineProperty(constructor.prototype, "_super", { value: basePrototype });
  159. Object.defineProperty(constructor.prototype, "constructor", { value: constructor });
  160. if (instanceMembers) {
  161. initializeProperties(constructor.prototype, instanceMembers);
  162. }
  163. if (staticMembers) {
  164. initializeProperties(constructor, staticMembers);
  165. }
  166. return constructor;
  167. } else {
  168. return define(constructor, instanceMembers, staticMembers);
  169. }
  170. }
  171. function mix(constructor) {
  172. /// <summary locid="15">
  173. /// Defines a class using the given constructor and the union of the set of instance members
  174. /// specified by all the mixin objects. The mixin parameter list can be of variable length.
  175. /// </summary>
  176. /// <param name="constructor" locid="9">
  177. /// A constructor function that will be used to instantiate this class.
  178. /// </param>
  179. /// <returns locid="12">
  180. /// The newly defined class.
  181. /// </returns>
  182. constructor = constructor || function () { };
  183. var i, len;
  184. for (i = 0, len = arguments.length; i < len; i++) {
  185. initializeProperties(constructor.prototype, arguments[i]);
  186. }
  187. return constructor;
  188. }
  189. // Establish members of "WinJS.Class" namespace
  190. WinJS.Namespace.define("WinJS.Class", {
  191. define: define,
  192. derive: derive,
  193. mix: mix
  194. });
  195. })(WinJS);
  196. })(this);