Browse Source

feat(weex): remove __weex_require_module__ api

dev
Hanks 7 years ago
committed by Evan You
parent
commit
a8146c0c10
  1. 4
      src/platforms/weex/entry-framework.js
  2. 12
      test/weex/runtime/framework.spec.js

4
src/platforms/weex/entry-framework.js

@ -91,9 +91,7 @@ export function createInstance (
// It will declare some instance variables like `Vue`, HTML5 Timer APIs etc.
const instanceVars = Object.assign({
Vue,
weex: weexInstanceVar,
// deprecated
__weex_require_module__: weexInstanceVar.requireModule // eslint-disable-line
weex: weexInstanceVar
}, timerAPIs, env.services)
if (!callFunctionNative(instanceVars, appCode)) {

12
test/weex/runtime/framework.spec.js

@ -261,7 +261,7 @@ describe('framework APIs', () => {
const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
data: {
x: 'Hello'
@ -361,9 +361,9 @@ describe('framework APIs', () => {
const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleBar = __weex_require_module__('bar')
const moduleBaz = __weex_require_module__('baz')
const moduleFoo = weex.requireModule('foo')
const moduleBar = weex.requireModule('bar')
const moduleBaz = weex.requireModule('baz')
new Vue({
render: function (createElement) {
const value = []
@ -592,7 +592,7 @@ describe('framework APIs', () => {
const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
mounted: function () {
moduleFoo.a(a => a + 1)
@ -624,7 +624,7 @@ describe('framework APIs', () => {
const instance = new Instance(runtime)
framework.createInstance(instance.id, `
const moduleFoo = __weex_require_module__('foo')
const moduleFoo = weex.requireModule('foo')
new Vue({
mounted: function () {
moduleFoo.a(this.$refs.x)

Loading…
Cancel
Save