Running the eval command on a mongos will not implicitly create the database, while running it on a mongod will. These two behaviors should be consistent. If the database doesn't exist, the command should always create it, or never create it, regardless of whether it's talking to a mongos or a mongod.
Because mongos cannot create a representation of the database without writing durable data, the behavior of mongod should be changed to match that of mongos.
This behavior was noticed while running a patch build using the --shuffle option to resmoke.py, eval7.js failed during the sharded_collections_jscore_passthrough suite with the following message:
This normally doesn't fail, as it usually isn't the first test to run, and the database will already exist by then.