compat es5

This commit is contained in:
pengfei.zhou 2020-01-16 15:16:29 +08:00 committed by osborn
parent 8ed3c42d3a
commit 7f089b6bcd
10 changed files with 13297 additions and 13153 deletions

View File

@ -547,7 +547,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -600,7 +600,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
@ -616,7 +616,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7EE2RX3L3P;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -635,7 +635,7 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7EE2RX3L3P;
INFOPLIST_FILE = Example/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

File diff suppressed because it is too large Load Diff

View File

@ -13,5 +13,46 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from 'core-js'
class ProxyPolyfill {
__target__: object
__handler__: ProxyHandler<object>
constructor(target: object, handler: ProxyHandler<object>) {
this.__target__ = target
this.__handler__ = handler
this.defineProps()
return target as ProxyPolyfill
}
defineProps() {
const keys = Object.keys(this.__target__)
keys.forEach(property => {
if (Object.getOwnPropertyDescriptor(this.__target__, property) !== undefined) {
return
}
Object.defineProperty(this, property, {
get: () => {
this.defineProps()
if (this.__handler__.get) {
return this.__handler__.get(this.__target__, property, this)
} else {
return (this.__target__ as any)[property]
}
},
set: (value) => {
this.defineProps()
if (this.__handler__.set) {
this.__handler__.set(this.__target__, property, value, property)
} else {
(this.__target__ as any)[property] = value
}
},
enumerable: true,
configurable: true,
})
})
}
}
const global = Function('return this')()
global.Proxy = ProxyPolyfill
export * from './src/runtime/sandbox'
export * from 'core-js'

View File

@ -1,2 +1,2 @@
export * from 'core-js';
export * from './src/runtime/sandbox';
export * from 'core-js';

View File

@ -13,5 +13,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from 'core-js';
class ProxyPolyfill {
constructor(target, handler) {
this.__target__ = target;
this.__handler__ = handler;
this.defineProps();
return target;
}
defineProps() {
const keys = Object.keys(this.__target__);
keys.forEach(property => {
if (Object.getOwnPropertyDescriptor(this.__target__, property) !== undefined) {
return;
}
Object.defineProperty(this, property, {
get: () => {
this.defineProps();
if (this.__handler__.get) {
return this.__handler__.get(this.__target__, property, this);
}
else {
return this.__target__[property];
}
},
set: (value) => {
this.defineProps();
if (this.__handler__.set) {
this.__handler__.set(this.__target__, property, value, property);
}
else {
this.__target__[property] = value;
}
},
enumerable: true,
configurable: true,
});
});
}
}
const global = Function('return this')();
global.Proxy = ProxyPolyfill;
export * from './src/runtime/sandbox';
export * from 'core-js';

2
doric-js/lib/src/polyfill.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
declare module 'core-js';
declare module 'proxy-polyfill/src/proxy';

View File

@ -0,0 +1 @@
"use strict";

View File

@ -25,6 +25,7 @@
"@types/ws": "^6.0.4",
"core-js": "^3.6.4",
"dts-bundle": "^0.7.3",
"proxy-polyfill": "^0.3.0",
"reflect-metadata": "^0.1.13",
"rollup": "^1.29.0",
"tslib": "^1.10.0",
@ -39,4 +40,4 @@
"@rollup/plugin-buble": "^0.21.0",
"@rollup/plugin-commonjs": "^11.0.1"
}
}
}

View File

@ -1 +0,0 @@
declare module 'core-js';

2
doric-js/src/polyfill.ts Normal file
View File

@ -0,0 +1,2 @@
declare module 'core-js';
declare module 'proxy-polyfill/src/proxy'