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

[WIP] Adds test flag for CSP edition #20

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

[WIP] Adds test flag for CSP edition #20

wants to merge 1 commit into from

Conversation

cognitom
Copy link
Member

@cognitom cognitom commented Dec 3, 2016

Currently CSP edition fails 15 tests (out of 70). Is it an expected behavior?
If not, I'd like to dive into the code more.

Output from mocha (failed)

  • Tmpl Tests riot-tmpl compiles specs expressions are just regular JavaScript:
    Error: expected undefined to equal 2
  • Tmpl Tests riot-tmpl compiles specs class shorthands expressions are just regular JavaScript:
    Error: expected '' to equal 'y'
  • Tmpl Tests riot-tmpl compiles specs class shorthands even function calls, objects and arrays are no problem:
    Error: expected '' to equal 'ok'
  • Tmpl Tests riot-tmpl 2.2.3 few errors in recognizing complex expressions:
    Error: expected '' to equal 'primary'
  • Tmpl Tests riot-tmpl 2.2.3 unwrapped keywords void, window and global, in addition to this:
    Error: expected undefined to be an object
  • Tmpl Tests riot-tmpl 2.2.3 you can include almost anything in quoted shorhand names:
    Error: expected undefined to equal 1
  • Tmpl Tests riot-tmpl 2.2.3 main inconsistence between expressions and class shorthands are gone:
    Error: expected 'Leto's house ' to equal ' '
  • Tmpl Tests riot-tmpl 2.3.0 does not wrap global and window object names:
    Error: expected undefined to be a number
  • Tmpl Tests riot-tmpl 2.3.0 unwrapped keywords: Infinity, isFinite, isNaN, Date, RegExp and Math:
    ReferenceError: isFinite is not defined
  • Tmpl Tests riot-tmpl 2.3.0 Fix riot#2002 issue with the JS_VARNAME regex failing in iOS 9.3.0:
    Error: expected undefined to equal 'Please choose from the 1 stores available'
  • Tmpl Tests riot-tmpl 2.3.0 catch errors in expressions with tmpl.errorHandler GOTCHA: null as param for call([this]) defaults to global too:
    Error: expected { tagName: null, _riot_id: null } to sort of equal { tagName: undefined, _riot_id: undefined }
  • Tmpl Tests brackets single and multi character custom brackets:
    Error: expected undefined to equal 'x'
  • Tmpl Tests brackets using brackets inside expressions though escaping is optional:
    Error: expected undefined to equal '{"x":5}'
  • Tmpl Tests brackets 2.2.3 escaping is almost unnecessary with custom brackets to "[ ]" (bad idea):
    Error: expected undefined to equal 'x'
  • Tmpl Tests brackets 2.2.3 escaping is almost unnecessary with custom brackets to "( )" (another bad idea):
    Error: expected undefined to equal 'x'

@GianlucaGuarini
Copy link
Member

@cognitom the csp version can not pass 100% all the test simply because it's not the same as Function() I would not invest time fixing this issue since we could completely remove it in the next major riot releases

@cognitom
Copy link
Member Author

cognitom commented Dec 3, 2016

@GianlucaGuarini yeah, I know CSP edition can't retrieve global variables and so on, because of the limitation of notevil. But I didn't know dot-concatenated variables like obj.val or opts.something are also unavailable.

I agree that we shouldn't use our time to fix this issue. But I'd like to just add some note on its documentation. Do you have any information which kind of expression we can use?

@GianlucaGuarini
Copy link
Member

@cognitom I guess dot concatenated variable should be supported I will have a look

@cognitom
Copy link
Member Author

cognitom commented Dec 4, 2016

@GianlucaGuarini thank you!

I've just come by this issue while trying to rewrite my chrome extension into Riot. But it's been working at this point (unfortunately with React...). So no need to hurry.

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