MCPcopy
hub / github.com/jprichardson/string.js / getNativeStringPropertyNames

Function getNativeStringPropertyNames

lib/string.js:738–760  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

736 }
737
738 function getNativeStringPropertyNames() {
739 var results = [];
740 if (Object.getOwnPropertyNames) {
741 results = Object.getOwnPropertyNames(__nsp);
742 results.splice(results.indexOf('valueOf'), 1);
743 results.splice(results.indexOf('toString'), 1);
744 return results;
745 } else { //meant for legacy cruft, this could probably be made more efficient
746 var stringNames = {};
747 var objectNames = [];
748 for (var name in String.prototype)
749 stringNames[name] = name;
750
751 for (var name in Object.prototype)
752 delete stringNames[name];
753
754 //stringNames['toString'] = 'toString'; //this was deleted with the rest of the object names
755 for (var name in stringNames) {
756 results.push(name);
757 }
758 return results;
759 }
760 }
761
762 function Export(str) {
763 return new S(str);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected