tmpl icon indicating copy to clipboard operation
tmpl copied to clipboard

[WIP] Adds test flag for CSP edition

Open cognitom opened this issue 9 years ago • 4 comments

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'

cognitom avatar Dec 03 '16 09:12 cognitom

@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

GianlucaGuarini avatar Dec 03 '16 14:12 GianlucaGuarini

@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?

cognitom avatar Dec 03 '16 15:12 cognitom

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

GianlucaGuarini avatar Dec 03 '16 16:12 GianlucaGuarini

@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.

cognitom avatar Dec 04 '16 07:12 cognitom