Skip to content

Conversation

@wuliang142857
Copy link

@wuliang142857 wuliang142857 commented Aug 15, 2017

before

// test code: 
function test(name) {
    return function (target) {
        return target;
    };
}

function foo(target) {
   return target;
}

class Bar {
    getName(@test("name") name1) {
        return name1;
    }

     getFoo(@foo name1) {
        return name1;
    }
}

// the transform Bar#getName like
function getName(_name2) {
    var _name3 = test("name")(_name2);
    return _name3;
}

// the transform Bar#getFoo like
function getFoo(_name2) {
    var _name3 = test(_name2);
    return _name3;
}

now

// the transform Bar#getName like
function getName(_name2) {
    var _name3 = test.call(this, "name").call(this, _name2);
    return _name3;
}

// the transform Bar#getFoo like
function getFoo(_name2) {
    var _name3 = test.bind(this).call(this, _name2);
    return _name3;
}

then we can visit properties of Bar in parameter decorators.

thanks

@benderTheCrime
Copy link
Owner

Tests appear to be failing in TravisCI. Do you have any indication as to why this might be?

@wuliang142857
Copy link
Author

OK, fixed it now

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants