Commit f14d0421 authored by Lwd's avatar Lwd

commit

parent a9489a3b
......@@ -70,6 +70,9 @@ cc.Class({
},
init: function () {
var canvaSize = this.findCanvas();
cc.director._scene.width = canvaSize.width;
cc.director._scene.height = canvaSize.height;
var diff = canvaSize.width / canvaSize.height;
var bili = 750 / 1334;
if (diff > bili) {
......
......@@ -5,7 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
!(function(global) {
cc.sys.capabilities["touches"] = true;
!(function (global) {
"use strict";
var Op = Object.prototype;
......@@ -78,9 +80,9 @@
// .constructor.prototype properties for functions that return Generator
// objects. For full spec compliance, you may wish to configure your
// minifier not to mangle the names of these two functions.
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
function Generator() { }
function GeneratorFunction() { }
function GeneratorFunctionPrototype() { }
// This is a polyfill for %IteratorPrototype% for environments that
// don't natively support it.
......@@ -109,14 +111,14 @@
// Helper for defining the .next, .throw, and .return methods of the
// Iterator interface in terms of a single ._invoke method.
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
prototype[method] = function(arg) {
["next", "throw", "return"].forEach(function (method) {
prototype[method] = function (arg) {
return this._invoke(method, arg);
};
});
}
runtime.isGeneratorFunction = function(genFun) {
runtime.isGeneratorFunction = function (genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor
? ctor === GeneratorFunction ||
......@@ -126,7 +128,7 @@
: false;
};
runtime.mark = function(genFun) {
runtime.mark = function (genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
......@@ -143,7 +145,7 @@
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
// `hasOwn.call(value, "__await")` to determine if the yielded value is
// meant to be awaited.
runtime.awrap = function(arg) {
runtime.awrap = function (arg) {
return { __await: arg };
};
......@@ -158,14 +160,14 @@
if (value &&
typeof value === "object" &&
hasOwn.call(value, "__await")) {
return Promise.resolve(value.__await).then(function(value) {
return Promise.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function(err) {
}, function (err) {
invoke("throw", err, resolve, reject);
});
}
return Promise.resolve(value).then(function(unwrapped) {
return Promise.resolve(value).then(function (unwrapped) {
// When a yielded Promise is resolved, its final value becomes
// the .value of the Promise<{value,done}> result for the
// current iteration. If the Promise is rejected, however, the
......@@ -191,7 +193,7 @@
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new Promise(function(resolve, reject) {
return new Promise(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
......@@ -231,14 +233,14 @@
// Note that simple async functions are implemented on top of
// AsyncIterator objects; they just return a Promise for the value of
// the final result produced by the iterator.
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
runtime.async = function (innerFn, outerFn, self, tryLocsList) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList)
);
return runtime.isGeneratorFunction(outerFn)
? iter // If outerFn is a generator, return the full iterator.
: iter.next().then(function(result) {
: iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
};
......@@ -366,7 +368,7 @@
var info = record.arg;
if (! info) {
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
......@@ -414,11 +416,11 @@
// iterator prototype chain incorrectly implement this, causing the Generator
// object to not be returned from this call. This ensures that doesn't happen.
// See https://github.com/facebook/regenerator/issues/274 for more details.
Gp[iteratorSymbol] = function() {
Gp[iteratorSymbol] = function () {
return this;
};
Gp.toString = function() {
Gp.toString = function () {
return "[object Generator]";
};
......@@ -453,7 +455,7 @@
this.reset(true);
}
runtime.keys = function(object) {
runtime.keys = function (object) {
var keys = [];
for (var key in object) {
keys.push(key);
......@@ -523,7 +525,7 @@
Context.prototype = {
constructor: Context,
reset: function(skipTempReset) {
reset: function (skipTempReset) {
this.prev = 0;
this.next = 0;
// Resetting context._sent for legacy support of Babel's
......@@ -549,7 +551,7 @@
}
},
stop: function() {
stop: function () {
this.done = true;
var rootEntry = this.tryEntries[0];
......@@ -561,7 +563,7 @@
return this.rval;
},
dispatchException: function(exception) {
dispatchException: function (exception) {
if (this.done) {
throw exception;
}
......@@ -579,7 +581,7 @@
context.arg = undefined;
}
return !! caught;
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
......@@ -621,7 +623,7 @@
}
},
abrupt: function(type, arg) {
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev &&
......@@ -655,7 +657,7 @@
return this.complete(record);
},
complete: function(record, afterLoc) {
complete: function (record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
......@@ -674,7 +676,7 @@
return ContinueSentinel;
},
finish: function(finallyLoc) {
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
......@@ -685,7 +687,7 @@
}
},
"catch": function(tryLoc) {
"catch": function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
......@@ -703,7 +705,7 @@
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
delegateYield: function (iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName: resultName,
......@@ -723,5 +725,5 @@
// In sloppy mode, unbound `this` refers to the global object, fallback to
// Function constructor if we're in global strict mode. That is sadly a form
// of indirect eval which violates Content Security Policy.
(function() { return this })() || Function("return this")()
(function () { return this })() || Function("return this")()
);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment