kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Missed Context.javaToJS() conversion #227

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. WEB-INF/jslib/blog.js:

Class({
  id : "Blog",
  properties : {
    title : { type : "string" },
    body : { type : "string" },
    author : { type : "string", readonly : true, optional : true },
    created : { type : "integer", readonly : true, optional : true },
    modified : { type : "integer", optional : true }
  },
  prototype : {
    initialize : function() {
      this.author = getCurrentUser().id;
      this.created = (new Date()).getTime();
    },
    onSave : function() {
      this.modified = (new Date()).getTime();
    }
  }
});

2. Create user: User.createUser("admin", "asdf");

3. Make POST request:

POST /Blog '{ title: "post 1", body : "<p>This is the content!</p>" }' -u 
admin:asdf

What is the expected output? What do you see instead?
Expect, and get, a correct HTTP response, however in the console you see the 
following Rhino 
warning:

js>WARNING: message: RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object org.mozilla.javascript.UniqueTag@5b17d6bc: 
NOT_FOUND of 
class org.mozilla.javascript.UniqueTag where it expected String, Number, 
Boolean or Scriptable 
instance. Please check your code for missing Context.javaToJS() call. source: 
null #0:0
null
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object org.mozilla.javascript.UniqueTag@5b17d6bc: 
NOT_FOUND of 
class org.mozilla.javascript.UniqueTag where it expected String, Number, 
Boolean or Scriptable 
instance. Please check your code for missing Context.javaToJS() call.
WARNING: message: RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object org.mozilla.javascript.UniqueTag@5b17d6bc: 
NOT_FOUND of 
class org.mozilla.javascript.UniqueTag where it expected String, Number, 
Boolean or Scriptable 
instance. Please check your code for missing Context.javaToJS() call. source: 
null #0:0
null
RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
Rhino runtime detected object org.mozilla.javascript.UniqueTag@5b17d6bc: 
NOT_FOUND of 
class org.mozilla.javascript.UniqueTag where it expected String, Number, 
Boolean or Scriptable 
instance. Please check your code for missing Context.javaToJS() call.

What version of the product are you using? On what operating system?
Using svn r573 on OSX.

Original issue reported on code.google.com by Micha.Ni...@gmail.com on 29 Jul 2009 at 4:41

GoogleCodeExporter commented 8 years ago

Original comment by kris...@gmail.com on 13 Aug 2009 at 9:35