2d.canvas.context.type.exists

The 2D context interface is a property of 'window'

Defined in "Web IDL" (draft)