Index: Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
diff --git a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
index 5a9f5004db3bb89481fccb72a5893a99aa26bc11..81a92846cbaeef599fa6ae32853a3052f8368be3 100644 |
--- a/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
+++ b/Source/bindings/dart/custom/DartOscillatorNodeCustom.cpp |
@@ -37,10 +37,27 @@ namespace WebCore { |
namespace DartOscillatorNodeInternal { |
-void typeSetter(Dart_NativeArguments) |
+void typeSetter(Dart_NativeArguments args) |
{ |
- // FIXME: proper implementation. |
- DART_UNIMPLEMENTED(); |
+ Dart_Handle exception = 0; |
+ { |
+ OscillatorNode* receiver = DartDOMWrapper::receiver<OscillatorNode>(args); |
+ |
+ String type = DartUtilities::dartToString(args, 1, exception); |
+ if (exception) |
+ goto fail; |
+ |
+ if (type == "sine" || type == "square" || type == "sawtooth" || type == "triangle") { |
+ receiver->setType(type); |
+ return; |
+ } |
+ |
+ exception = Dart_NewStringFromCString("Illegal OscillatorNode type"); |
+ } |
+ |
+fail: |
+ Dart_ThrowException(exception); |
+ ASSERT_NOT_REACHED(); |
} |
} |