Skip to content
This repository
Browse code

Change method to assure use of constructor

Previously we were using 'this === global', which doesn't seem to work as well as '!(this instanceof Tabletop)'. Not that I know anything, just was being screwy in Mapsheet.
  • Loading branch information...
commit 71c7f412a8ad9d7406faf32b0b6bad94dfb2299f 1 parent da23dcb
Jonathan Soma authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  src/tabletop.js
2  src/tabletop.js
@@ -26,7 +26,7 @@
26 26
27 27 var Tabletop = global.Tabletop = function(options) {
28 28 // Make sure Tabletop is being used as a constructor no matter what.
29   - if(!this || this === global) {
  29 + if(!this || !(this instanceof Tabletop)) {
30 30 return new Tabletop(options);
31 31 }
32 32

0 comments on commit 71c7f41

Please sign in to comment.
Something went wrong with that request. Please try again.