Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsfm] make private method as functional as possible #777

Merged
merged 5 commits into from
Jul 13, 2016
Merged

[jsfm] make private method as functional as possible #777

merged 5 commits into from
Jul 13, 2016

Conversation

Jinjiang
Copy link
Contributor

e.g.

Vm.prototype._xxx = function (a, b, c) {
   // this
}

function Vm() {
  this._xxx(1, 2, 3)
}

will be converted to:

function xxx (vm, a, b, c) {
  // vm
}

function Vm() {
  xxx(vm, 1, 2, 3)
}

benefits:

  1. protect the private method not exposed to developer
  2. easy to trace the method source through import
  3. easy to test
  4. possible to minify the name (prototype member names cannot be minified)

@IskenHuang IskenHuang merged commit d971680 into alibaba:jsfm-feature-0.15 Jul 13, 2016
@Jinjiang Jinjiang deleted the jsfm-feature-functional branch July 13, 2016 04:10
Hanks10100 pushed a commit that referenced this pull request Oct 10, 2016
[jsfm] make private method as functional as possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants