develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34669 - trunk/runtime/parrot/library

From:
coke
Date:
December 30, 2008 13:04
Subject:
[svn:parrot] r34669 - trunk/runtime/parrot/library
Message ID:
20081230210406.A0276CB9FA@x12.develooper.com
Author: coke
Date: Tue Dec 30 13:04:05 2008
New Revision: 34669

Modified:
   trunk/runtime/parrot/library/JSON.pir

Log:
take advantage of calling conventions and an opcode that probably didn't exist when this written.



Modified: trunk/runtime/parrot/library/JSON.pir
==============================================================================
--- trunk/runtime/parrot/library/JSON.pir	(original)
+++ trunk/runtime/parrot/library/JSON.pir	Tue Dec 30 13:04:05 2008
@@ -123,18 +123,15 @@
 .end
 
 .sub '_json_string'
-  .param pmc thing
+  .param string thing
   .param int pretty
   .param int indent
 
   .local string result
 
-  $S0 = thing
-  .local pmc escaper
-  escaper = find_global "Data::Escape", "String"
-  $S0 = escaper($S0,'"')
+  thing = escape thing
 
-  result = '"' . $S0
+  result = '"' . thing
   result = result . '"'
 
   unless pretty goto plain



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About