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

Strict mode not ok yet in the tracifier branch #2

Open
algobardo opened this issue Aug 17, 2017 · 1 comment
Open

Strict mode not ok yet in the tracifier branch #2

algobardo opened this issue Aug 17, 2017 · 1 comment

Comments

@algobardo
Copy link

algobardo commented Aug 17, 2017

Some of the changes in the tracifier branch cannot be applied.
Tajs test this code for strict mode

(function(){
   'use strict';
   try { 
     function f(){TAJS_assertEquals(undefined, this)};
     f();
   } catch (e) { 
     TAJS_assert(false);
   }
})();

which generates

                           ....
                            f = J$.N(169, 'f', J$.T(161, f, 12, false, 65), 0);
                           ....
                            try {
                                var f = function f() {
                                    'use strict';
                                     ....

Now, note that at the T invocation f is not initialised yet: f = undefined, because f is not hoisted since it is no longer a function declaration.
So when the strict mode is set to f in T, a TypeError is thrown.

@algobardo algobardo changed the title Strict mode not ok yet Strict mode not ok yet in the tracifier branch Aug 17, 2017
@algobardo
Copy link
Author

@christofferqa any quick idea ?

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

No branches or pull requests

1 participant