diff -r 90d417fd526c -r 41be00d23622 samples/counters.js --- a/samples/counters.js Wed May 07 21:33:30 2014 -0700 +++ b/samples/counters.js Wed May 07 20:20:58 2014 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,7 +33,11 @@ * This file can be run along with any script you want to run * to print aggregate stat counters from nashorn. * - * Usage: jjs counters.js + * Usage: jjs -J-Dnashorn.debug counters.js */ -Debug.dumpCounters(); +if (java.lang.System.getProperty("nashorn.debug") == null) { + print("Usage: jjs -J-Dnashorn.debug counters.js"); +} else { + Debug.dumpCounters(); +}