001 package com.google.gwt.maps.client.workaround;
002
003 import com.google.gwt.core.client.GWT;
004 import com.google.gwt.core.client.JavaScriptObject;
005
006 public class WorkAroundUtils {
007
008 /**
009 * When a third party api complains about this extra element in the object. This only happens in DevMode
010 * The JSO carries an __gwt_ObjectId in devMode, which needs to be removed in some cases.
011 * @param jso
012 */
013 public final static void removeGwtObjectId(JavaScriptObject jso) {
014 if (jso == null) {
015 return;
016 }
017 if (!GWT.isScript()) {
018 removeGwtObjectIdImpl(jso);
019 }
020 }
021
022 private final static native void removeGwtObjectIdImpl(JavaScriptObject jso) /*-{
023 delete jso['__gwt_ObjectId'];
024 }-*/;
025
026 }
027