Changeset 21095 for lang/javascript
- Timestamp:
- 10/11/08 02:20:13 (3 months ago)
- Location:
- lang/javascript/hsp-on-js/trunk
- Files:
-
- 3 modified
-
samples.html (modified) (2 diffs)
-
src/builtin-funcs.js (modified) (2 diffs)
-
src/evaluator.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/hsp-on-js/trunk/samples.html
r20969 r21095 8 8 <title>HSP on JS</title> 9 9 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js"></script> 10 <script type="text/javascript" src="hsp-on-js-core-0.0. 4.js" charset="utf-8"></script>10 <script type="text/javascript" src="hsp-on-js-core-0.0.5.js" charset="utf-8"></script> 11 11 <script type="text/javascript"> 12 12 HSPonJS.emptyFunction = function(){}; … … 319 319 <div> 320 320 <textarea cols="100" rows="10"> 321 sdim buf, 10000 322 bload "samples.html", buf// この HTML ファイル自身の内容を取得321 notesel buf 322 noteload "samples.html" // この HTML ファイル自身の内容を取得 323 323 ins = instr(buf, 0, "<body") 324 324 ins2 = instr(buf, ins, "<h2") -
lang/javascript/hsp-on-js/trunk/src/builtin-funcs.js
r21094 r21095 246 246 this.scanArgs(arguments, 's'); 247 247 path = path.toStrValue()._value; 248 throw new FileReadException( 249 path, 250 function(data) { this.strsize = new IntValue(data.length); }, 251 function() { this.strsize = new IntValue(-1); }); 248 this.fileRead(path, 249 function(data) { this.strsize = new IntValue(data.length); }, 250 function() { this.strsize = new IntValue(-1); }); 252 251 }, 253 252 0x16: function bload(path, v) { 253 // FIXME 第三引数のサイズ、第四引数のオフセットに対応 254 254 this.scanArgs(arguments, 'sv'); 255 255 path = path.toStrValue()._value; 256 th row new FileReadException(256 this.fileRead( 257 257 path, 258 258 function(data) { … … 392 392 var length = val.lineLengthIncludeCR(index); 393 393 note.splice(index, length, ''); 394 }, 395 0x25: function noteload(path) { 396 // FIXME 第二引数のサイズ上限に対応 397 this.scanArgs(arguments, 's'); 398 path = path.toStrValue()._value; 399 var note = this.getNote(); 400 this.fileRead( 401 path, 402 function(data) { 403 data = CP932.encode(data) + "\0"; 404 note.expandByteSize(data.length); 405 note.setbytes(0, data); 406 }, 407 function() { 408 throw new HSPError(ErrorCode.FILE_IO); 409 }); 394 410 }, 395 411 0x27: function randomize(seed) { -
lang/javascript/hsp-on-js/trunk/src/evaluator.js
r21094 r21095 209 209 } 210 210 return this.noteStack[this.noteStack.length - 1]; 211 }, 212 fileRead: function fileRead(path, success, error) { 213 throw new FileReadException(path, success, error); 211 214 }, 212 215 getBuiltinFuncName: function getBuiltinFuncName(insn) {
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)