Fix protected mixin override for ES3 fallbacks
It's fun when you're about to make a release and find that ES3 fallback tests are failing. That's also what happens when you decide not to run the combined tests until the last minute, because they usually don't fail.master
parent
903a1a135c
commit
8707e537ab
14
lib/Trait.js
14
lib/Trait.js
|
@ -740,8 +740,18 @@ function mixMethods( src, dest, vis, iname, inparent )
|
|||
continue;
|
||||
}
|
||||
|
||||
var keywords = src[ f ].___$$keywords$$,
|
||||
vis = keywords['protected'] ? 'protected' : 'public';
|
||||
var keywords = src[ f ].___$$keywords$$;
|
||||
|
||||
// TODO: This is a kluge to handle ES3 fallbacks, which will cause
|
||||
// protected members to appear on the public prototype. A more
|
||||
// elegant solution is to automatically add the public keyword when
|
||||
// the class is built, so we can just check if keywords[vis] exists.
|
||||
if ( ( vis === 'public' ) && keywords[ 'protected' ] )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
vis = keywords[ 'protected' ] ? 'protected' : 'public';
|
||||
|
||||
// if abstract, then we are expected to provide the implementation;
|
||||
// otherwise, we proxy to the trait's implementation
|
||||
|
|
Loading…
Reference in New Issue