1. rude
  2. love

Issues

Issue #690 resolved

Error checking for misspelled enums

hahawoo
created an issue

I think these should error, and it might be nice if it gave a list of accepted enum values in the error message.

love.filesystem.newFileData('', '', 'hehehe')
love.graphics.newSpriteBatch(love.graphics.newImage(love.image.newImageData(1, 1)), 1, 'hehehe')
source = love.audio.newSource('music.ogg', 'hehehe')
source:seek(1, 'hehehe')
source:tell('hehehe')
love.physics.newBody(love.physics.newWorld(), 0, 0, 'hehehe')
love.graphics.isSupported('hehehe') -- Like how it is currently though, I don't think it should error when given no arguments, because this might be useful in practice.

Comments (6)

  1. hahawoo reporter

    Yeah, and plus if it's a typo it's probably easy enough to see the misspelling.

    Just wondering, why wasn't love.graphics.isSupported changed?

  2. Alex Szpakowski

    It's more consistent to change it, but I've used the fact that it doesn't error like that in the past to have nicer code across LÖVE versions which change the isSupported strings (e.g. "pixeleffect" to "shader".)

    I haven't completely made up my mind yet. :p

  3. Log in to comment