/*!
* jQuery JavaScript Library v3.6.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2021-03-02T17:08Z
*/
(function (global, factory) {
"use strict";
if (typeof module === "object" && typeof module.exports === "object") {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document
? factory(global, true)
: function (w) {
if (!w.document) {
throw new Error("jQuery requires a window with a document");
}
return factory(w);
};
} else {
factory(global);
}
// Pass this if window is not defined yet
})(typeof window !== "undefined" ? window : this, function (window, noGlobal) {
// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
// enough that all such attempts are guarded in a try block.
"use strict";
var arr = [];
var getProto = Object.getPrototypeOf;
var slice = arr.slice;
var flat = arr.flat
? function (array) {
return arr.flat.call(array);
}
: function (array) {
return arr.concat.apply([], array);
};
var push = arr.push;
var indexOf = arr.indexOf;
var class2type = {};
var toString = class2type.toString;
var hasOwn = class2type.hasOwnProperty;
var fnToString = hasOwn.toString;
var ObjectFunctionString = fnToString.call(Object);
var support = {};
var isFunction = function isFunction(obj) {
// Support: Chrome <=57, Firefox <=52
// In some browsers, typeof returns "function" for HTML <object> elements
// (i.e., `typeof document.createElement( "object" ) === "function"`).
// We don't want to classify *any* DOM node as a function.
// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
// Plus for old WebKit, typeof returns "function" for HTML collections
// (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
return (
typeof obj === "function" &&
typeof obj.nodeType !== "number" &&
typeof obj.item !== "function"
);
};
var isWindow = function isWindow(obj) {
return obj != null && obj === obj.window;
};
var document = window.document;
var preservedScriptAttributes = {
type: true,
src: true,
nonce: true,
noModule: true,
};
function DOMEval(code, node, doc) {
doc = doc || document;
var i,
val,
script = doc.createElement("script");
script.text = code;
if (node) {
for (i in preservedScriptAttributes) {
// Support: Firefox 64+, Edge 18+
// Some browsers don't support the "nonce" property on scripts.
// On the other hand, just using `getAttribute` is not enough as
// the `nonce` attribute is reset to an empty string whenever it
// becomes browsing-context connected.
// See https://github.com/whatwg/html/issues/2369
// See https://html.spec.whatwg.org/#nonce-attributes
// The `node.getAttribute` check was added for the sake of
// `jQuery.globalEval` so that it can fake a nonce-containing node
// via an object.
val = node[i] || (node.getAttribute && node.getAttribute(i));
if (val) {
script.setAttribute(i, val);
}
}
}
doc.head.appendChild(script).parentNode.removeChild(script);
}
function toType(obj) {
if (obj == null) {
return obj + "";
}
// Support: Android <=2.3 only (functionish RegExp)
return typeof obj === "object" || typeof obj === "function"
? class2type[toString.call(obj)] || "object"
: typeof obj;
}
/* global Symbol */
// Defining this global in .eslintrc.json would create a danger of using the global
// unguarded in another place, it seems safer to define global only for this module
var version = "3.6.0",
// Define a local copy of jQuery
jQuery = function (selector, context) {
// The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init(selector, context);
};
jQuery.fn = jQuery.prototype = {
// The current version of jQuery being used
jquery: version,
constructor: jQuery,
// The default length of a jQuery object is 0
length: 0,
toArray: function () {
return slice.call(this);
},
// Get the Nth element in the matched element set OR
// Get the whole matched element set as a clean array
get: function (num) {
// Return all the elements in a clean array
if (num == null) {
return slice.call(this);
}
// Return just the one element from the set
return num < 0 ? this[num + this.length] : this[num];
},
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function (elems) {
// Build a new jQuery matched element set
var ret = jQuery.merge(this.constructor(), elems);
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
// Return the newly-formed element set
return ret;
},
// Execute a callback for every element in the matched set.
each: function (callback) {
return jQuery.each(this, callback);
},
map: function (callback) {
return this.pushStack(
jQuery.map(this, function (elem, i) {
return callback.call(elem, i, elem);
})
);
},
slice: function () {
return this.pushStack(slice.apply(this, arguments));
},
first: function () {
return this.eq(0);
},
last: function () {
return this.eq(-1);
},
even: function () {
return this.pushStack(
jQuery.grep(this, function (_elem, i) {
return (i + 1) % 2;
})
);
},
odd: function () {
return this.pushStack(
jQuery.grep(this, function (_elem, i) {
return i % 2;
})
);
},
eq: function (i) {
var len = this.length,
j = +i + (i < 0 ? len : 0);
return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
},
end: function () {
return this.prevObject || this.constructor();
},
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
push: push,
sort: arr.sort,
splice: arr.splice,
};
jQuery.extend = jQuery.fn.extend = function () {
var options,
name,
src,
copy,
copyIsArray,
clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if (typeof target === "boolean") {
deep = target;
// Skip the boolean and the target
target = arguments[i] || {};
i++;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && !isFunction(target)) {
target = {};
}
// Extend jQuery itself if only one argument is passed
if (i === length) {
target = this;
i--;
}
for (; i < length; i++) {
// Only deal with non-null/undefined values
if ((options = arguments[i]) != null) {
// Ext
JavaScript编译器Babel v7.21.3 Babel 是编写下一代 JavaScript 的编译器
需积分: 0 182 浏览量
更新于2023-04-02
收藏 22.15MB ZIP 举报
JavaScript编译器Babel在现代前端开发中扮演着至关重要的角色。它允许开发者使用尚未被所有浏览器完全支持的最新JavaScript语法(如ES6+)来编写代码,然后将其转换为广泛兼容的旧版本JavaScript,确保代码能在各种环境下的正确运行。Babel v7.21.3是这一系列编译器的一个特定版本,它带来了性能优化和一些新特性。
Babel的核心功能是转译(Transpiling)。当我们在代码中使用箭头函数、类声明、模板字符串等ES6+语法时,Babel会将这些语法转换为ES5语法,使得老旧的浏览器也能理解和执行。这个过程不仅包括语法层面的转换,还包括对新特性的模拟,例如Promise的实现。
Babel v7是一个重大更新,引入了模块化配置、更快的转换速度以及更好的错误处理。其中,模块化配置允许开发者只选择他们需要的插件和预设,减少不必要的转换,提高构建效率。例如,通过`.babelrc`或`babel.config.js`文件,我们可以精确控制Babel的行为。
Babel 7.21.3版本可能包含以下改进:
1. **性能提升**:通过优化内部算法和编译过程,Babel v7.21.3可能会提供更快的编译速度,这对于大型项目来说尤其重要,因为这能缩短开发者的构建时间。
2. **Bug修复**:每个版本的迭代都会修复前一版本中的已知问题,确保代码转换的准确性和稳定性。
3. **新特性支持**:Babel会不断跟进JavaScript的新标准,因此v7.21.3可能已经包含了对当时最新ES规范的支持。
4. **插件和预设更新**:Babel依赖于一系列插件和预设来完成其工作。这个版本可能包含了对这些工具的更新,以提供更广泛的语言特性和更好的兼容性。
5. **更好的社区支持**:随着版本的更新,Babel的文档和社区资源也会得到完善,开发者可以更容易地找到解决问题的方法和最佳实践。
为了使用Babel v7.21.3,开发者通常需要配置一个构建系统,如Webpack或Rollup,或者在命令行中直接运行Babel。配置文件中指定需要的插件和预设,例如`@babel/preset-env`可以帮助我们根据目标环境自动选择需要转换的特性。
Babel作为JavaScript的编译器,使开发者能够提前享受新的语言特性,而无需担心兼容性问题。Babel v7.21.3的发布意味着它继续致力于提供更高效、更稳定的转换服务,帮助开发者构建未来的Web应用。
weixin_54393129
- 粉丝: 0
- 资源: 5
最新资源
- 基于小程序的校园失物招领源码(小程序毕业设计完整源码+LW).zip
- 基于小程序的图书管理系统源码(小程序毕业设计完整源码+LW).zip
- 基于小程序的学生选课系统源码(小程序毕业设计完整源码+LW).zip
- 气动举升输送机sw18可编辑全套技术资料100%好用.zip
- 基于小程序的英语学习激励系统源码(小程序毕业设计完整源码+LW).zip
- 汽车密封条自动打孔裁断一体机sw18可编辑全套技术资料100%好用.zip
- 基于小程序的驾校预约管理系统源码(小程序毕业设计完整源码+LW).zip
- 汽车油泵盖组装机sw18可编辑全套技术资料100%好用.zip
- 智慧混凝土管理系统功能说明
- 美国芝加哥矢量边界shp 2024版
- JAVA大作业贪吃蛇-加上mysql数据库-课程设计
- 去镍机sw20可编辑全套技术资料100%好用.zip
- 全自动充磁机(含DFM)sw17可编辑全套技术资料100%好用.zip
- content_1735747612598.zip
- 全自动贴膜机(含cad)stp全套技术资料100%好用.zip
- 柔性链输送机设备sw18可编辑全套技术资料100%好用.zip