Skip to content

没有预解析阶段,导致变量不能提升 #6

Description

@axetroy

hm....

在实现async await的时候遇到的

变量提升到底是不是个好东西

const obj = {
  called: false
};

func();

function func() {
  obj.called = true;
}

module.exports = obj;

上面的代码是不能解释运行的..

因为解析到func()的时候,还没有func这个变量

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions