compat es5
This commit is contained in:
parent
8ed3c42d3a
commit
7f089b6bcd
@ -547,7 +547,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
@ -600,7 +600,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@ -616,7 +616,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = 7EE2RX3L3P;
|
DEVELOPMENT_TEAM = 7EE2RX3L3P;
|
||||||
INFOPLIST_FILE = Example/Info.plist;
|
INFOPLIST_FILE = Example/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@ -635,7 +635,7 @@
|
|||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = 7EE2RX3L3P;
|
DEVELOPMENT_TEAM = 7EE2RX3L3P;
|
||||||
INFOPLIST_FILE = Example/Info.plist;
|
INFOPLIST_FILE = Example/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -13,5 +13,46 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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 './src/runtime/sandbox'
|
||||||
|
export * from 'core-js'
|
||||||
|
2
doric-js/lib/index.runtime.es5.d.ts
vendored
2
doric-js/lib/index.runtime.es5.d.ts
vendored
@ -1,2 +1,2 @@
|
|||||||
export * from 'core-js';
|
|
||||||
export * from './src/runtime/sandbox';
|
export * from './src/runtime/sandbox';
|
||||||
|
export * from 'core-js';
|
||||||
|
@ -13,5 +13,45 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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 './src/runtime/sandbox';
|
||||||
|
export * from 'core-js';
|
||||||
|
2
doric-js/lib/src/polyfill.d.ts
vendored
Normal file
2
doric-js/lib/src/polyfill.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
declare module 'core-js';
|
||||||
|
declare module 'proxy-polyfill/src/proxy';
|
1
doric-js/lib/src/polyfill.js
Normal file
1
doric-js/lib/src/polyfill.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
"use strict";
|
@ -25,6 +25,7 @@
|
|||||||
"@types/ws": "^6.0.4",
|
"@types/ws": "^6.0.4",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
"dts-bundle": "^0.7.3",
|
"dts-bundle": "^0.7.3",
|
||||||
|
"proxy-polyfill": "^0.3.0",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"rollup": "^1.29.0",
|
"rollup": "^1.29.0",
|
||||||
"tslib": "^1.10.0",
|
"tslib": "^1.10.0",
|
||||||
|
1
doric-js/src/core-js.d.ts
vendored
1
doric-js/src/core-js.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
declare module 'core-js';
|
|
2
doric-js/src/polyfill.ts
Normal file
2
doric-js/src/polyfill.ts
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
declare module 'core-js';
|
||||||
|
declare module 'proxy-polyfill/src/proxy'
|
Reference in New Issue
Block a user